Quantcast
Browsing latest articles
Browse All 3 View Live

Answer by Mike Woolf for For any string "char name[10]="test"",is...

For a declared array like char name[10], sizeof(name) is the size of the entire array, regardless of what data is stored in it. strlen(name) returns the number of characters in the array before the...

View Article


Answer by autistic for For any string "char name[10]="test"",is...

Which book are you reading? sizeof is an operator that tells you how many bytes a type (or in your case, the type of an object) occupies. strlen is a function that tells you where the first '\0'...

View Article


For any string "char name[10]="test"",is strlen(name)+1 always guaranteed to...

For a string name[],can we use strlen(name)+1 and sizeof(name)interchangeably in our code without second thought?Aren't they same?I checked about it and found out even the return type for both is...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>