I'm surprised it even compiled.. the arra of chars you have is a character array, not an array of strings, which, by your code example, is what you are thinking it is. try txt[0]='a';
instead of "a" or "12". The single quotes say use on echaracter, the double quotes says use a null terminated string. so "12" = '1','2', and '\0'.. in memory.
while 'a' is just the single character 'a'.
If you want the string "hello" to show up, use
txt[0]='h';
txt[1]='e';
txt[2]='l'
txt[3]='l'
txt[4]='o'
txt[5]='\0'; // this is a zero, not a capital O
Good luck.
Horsedorf


LinkBack URL
About LinkBacks




