Answers for "c++ sizeof const char array"

C++
1

how to get size of char array in c++

char* example = "Lorem ipsum dolor sit amet";
int length = strlen(example);
std::cout << length << '\n'; // 26
Posted by: Guest on January-24-2021
0

c++ char array size

const char* Coffee = "Nescafe";

for(int i = 0; i < strlen(Coffee); i++)
{
    std::cout << Coffee[i] << "\n";
}
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language