I know how to program Java and now I'm trying to learn C programming.
I want to write out a String from an Array of chars that I have created, and write out every String in one line (I'm creating a console application).
So far I have got this;
int main()
{
int i;
int j;
char aarhus[] = {'\x8F','r','h','u','s',' ','H','\0'};
char esbjerg[] = {'E','s','b','j','e','r','g','\0'};
char stationer[] = {*aarhus,*esbjerg};
for (j=0;stationer[j] != '\0';j++) {
printf("%c\n", stationer[j]);
}
return 0;
}
with the includes in the top of course.
But when I launch the program, it only writes ÅEEsbjerg and not Århus Esbjerg (both on a single line for itself, as I want it to). If I add \0 in the stationer[], all I get is ÅE on the same line. I have been trying to fix this for hours but nothing so far. I hope you can help. Thanks in advance