Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What are the differences in len() and cap() functions of slice in go?



What are the differences in len() and cap() functions of slice in go?..

Answer / Priyanka Rani

The len() function returns the number of elements that a slice currently contains, while cap() returns the allocated capacity of the slice. If the capacity of a slice is not sufficient to append additional elements using the append() function, it will grow automatically when needed until its capacity matches the length.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Go Programming Language Interview Questions

What are channels in go language and how can you use them?

1 Answers  


Who is known as the father of go programming language?

1 Answers  


How you can write multiline strings in go?

1 Answers  


What is type “bool” default value?

1 Answers  


What gopath environment variable is?

1 Answers  


What is go routine in go? How you can stop go routine?

1 Answers  


What is go programming language? Explain

1 Answers  


What is default value of a global variable in go?

1 Answers  


What is default value of a global and local variable in go?

1 Answers  


What is go (golang) programming language?

1 Answers  


How a pointer is represented in go?

1 Answers  


Why should one use go programming language?

1 Answers  


Categories