Cheers...
Type: Posts; User: comp1911
Cheers...
Now that my table prints out properly i noticed that the leading zero is not printed out for the second header.....
Any reason this is so????
How can this be fixed
Ahhhh thanks....thats solved my problem.....
Hi everyone I am writing a program where the input data is to be formatted into a table...
The input looks like this:
Header Header Header Header Header
2081 12 2007 4 ...
Ummmm i haven't done pointers yet but im starting to get it....
Thanks for your time and help.....
i am also working on another program at the moment so if i get stuck i'll be sure to post it up in...
This is what the program does:
Enter 20 numbers:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Then this is what it prints:
1 2
3 4
5 6
7 8
9 10
11 12
this is what i got from the complier...
cc1: warnings being treated as errors
sort2d1.c: In function ‘main’:
sort2d1.c:29: error: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’
I followed that logic and it did end up working just fine...
but when i tried
for(i=0;i<10;i++){
printf("%d %d\n", array[i][0],array[i][1]);
}
it ended up printing the...
I worked around with my code and i changed my nestled loop a bit (i placed it right after the first loop) and this is what i ended up with...
#include <stdio.h>
int main (int argc, char...
This is what i get when i compile it
gcc -Wall -Werror -o sort2d sort2d.c
cc1: warnings being treated as errors
sort2d.c: In function ‘main’:
sort2d.c:13: error: format ‘%d’ expects type...
I have no clue why my code won't compile....I am trying to use 2d arrays to read in 20 numbers in pairs and have them print out each pair in a new line....
#include <stdio.h>
int main (int...