Ok, im new to c++ and i looked around and couldn't find anything on it..
I have a global char such as the one below, i made a loop to go through and basically "grab" each name in the names list and then display it to me.. but instead of displaying the actual name, it shows some number (4210704).. anyone know how i can fix this? thanks

char *names[]={
    "test",
    "same",
};

I also get the same problem when trying to display text like the code below, i don't know what i'm doing wrong.. i get a number almost every time instead of the text in the char.. what am i doing wrong people?

char name[] = "bob";
char send[512];
sprintf(send, "testing this %d\n",name);

Edited 3 Years Ago by pyTony: fixed formating

what am i doing wrong people?

char name[] = "bob";
char send[512];
sprintf(send, "testing this %d\n",name);

Use %s for strings; %d is for ints.

Your reply solved my problem, i didn't think there was a difference between the two (%s %d) but now i know there is. :)
Thanks

This question has already been answered. Start a new discussion instead.