I'm learning C programming and I'm having some issues to print a name that i store in a char array.
char nameArr[125];
for (int i = 0; i < 125; i++)
{
if (nameArr[i] != "\0")
{
printf(nameArr[i]);
}
else
{
i = 125;
}
}
This is my code in which I try to print out a name like "Joe Doe" that I already stored in the char array, but I get some errors in the compiler when I run this. If I'm not suppose to do like this, how can I print out just the name and not all the 125 slots of the array?