Hi,
I have a problem with char arrays and pointers. I think it's an obvious begginer issue but I can't figure out why do I get this.
I have this piece of code in my program:
And my output is a seven characters array, aaabbb��Code:char readbuffers[3] = "bbb"; char readbuffer[3] = "aaa"; printf("%s\n", readbuffer); char *codCliente = argv[2]; char *tipoCliente = argv[3]; char *Distancia = argv[7]; char *tipoTrayecto = argv[8]; printf("%s\n", codCliente); printf("%s\n", tipoCliente); printf("%s\n", Distancia); printf("%s\n", tipoTrayecto);
Why the arrays are automatically appending?
Thank you in advance.



LinkBack URL
About LinkBacks




