for exmaple:
how to set the whoe array has no value at the beginning and how to if it has and charater inside??Code:char buff[6][35];
use the function strcmp()??
thank you for helping.
for exmaple:
how to set the whoe array has no value at the beginning and how to if it has and charater inside??Code:char buff[6][35];
use the function strcmp()??
thank you for helping.
Code:#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> int main() { int i,j; char buff[5][3]={0}; // this initializes the whole thing to 0 (null) for (i=0;i<5;i++) for(j=0;j<2;j++) if(buff[i][j]) printf("found %c\n", buff[i][j]); else printf("nothing here\n"); strcpy(buff[2],"ab"); for (i=0;i<5;i++) for(j=0;j<2;j++) if(buff[i][j]) printf("found %c\n", buff[i][j]); else printf("nothing here\n"); system("PAUSE"); return 0; }