-
printing
sup all i am just practicing in pointers so i can learn it well .. ok i have creating this little wantabe programm.. now there is nothing wrong with it.. but i want to know how can i make the output print in a line instead of it going up... (sorry i dont know how to explain very well) here is the code
Code:
int main()
{
char hello[27] = "abcdefghijklmnopqrstuvwxyz";
char *p;
int i;
p = hello;
for (i=0; p[i]; i++)
printf("%c\n",p[i]);
return 0;
}
i want it like
abcdefghijg etc..
not
a
b
c
d
etc.
-
Then remove the "\n" from the printf
-
ok but how did you know that..... this is my point how would i figure that out if i was not to post in here..? educate me please
-
"\n" starts a new line
with no "\n" no new line will be started
-
:)
You learn by reading & experimenting.....it just takes a little effort and time.....
BTW, \n is an alias for the 10th ASCII char.....it's usually used to denote a Line feed....
Here...save this gif to your computer for reference