Answers for "character type array size in c++"

C++
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
0

how to find the size of a character array in c++

Instead of sizeof() for finding the length of strings or character 
arrays, just use strlen(string_name) with the header file
#include <cstring>   
it's easier.
Posted by: Guest on May-02-2020

Browse Popular Code Answers by Language