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...


How is len() different from cap() function?



How is len() different from cap() function?..

Answer / Arun Pratap Saroj

len() returns the length of a slice or string, while cap() returns the allocated capacity (maximum length) of a slice. For example, if you have a slice with length 5 and capacity 10, len() would return 5 and cap() would return 10.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Go Programming Language Interview Questions

How can you check a variable type at runtime in go programming language?

1 Answers  


Why golang is fast?

1 Answers  


Does go programming language support type inheritance?

1 Answers  


What is go programming language? Explain

1 Answers  


Why does my go process use a lot of virtual memory?

1 Answers  


What are channels and how can you use them in golang?

1 Answers  


What is type casting in golang?

1 Answers  


Is it true that short variable declaration := can be used only inside a function?

1 Answers  


How pointer is represented in go?

1 Answers  


Is “maps” value types?

1 Answers  


How would you print type of variable in go?

1 Answers  


How can an entry be deleted from a map?

1 Answers  


Categories