0

How we use sizeof in string?

11/8/2019 2:42:01 PM

ashutosh apurva

3 Answers

New Answer

+2

C++ : Using sizeof with a string results in the size of whole string. Example:- char str[10]="Sololearn"; cout<<sizeof(str); Output will be 10 (one character occupies 1 byte, so a 10 character string will be of 10 bytes) 🤟

0

👍👍👍

0

int sizeOfStr = sizeof(str) / sizeof(char);