Can anyone show me where I'm going wrong here?

[code]#include
main()
{
int i,j;

printf("These are the results of the first for loop:
");
for (i=0, j=1; i<8; i++, j++)
printf("%d + %d = %d
", i, j, i+j);
printf("These are the results of the second loop:
");
for (i=0, j=1; i<8; i++, j++)
printf("%d + %d = %d
", i, j, i+j);

return 0;
}
[/code]

I keep getting the message for the compiler that I have the wrong number of argument calls for the printf lines of the for loops. >_<

Comments

  • It compiled just fine as is, with gcc. What compiler are you using?
    [code]
    [[email protected] robert]$ gcc nymph.c -o nymph
    [[email protected] robert]$ ./nymph
    These are the results of the first for loop:
    0 + 1 = 1
    1 + 2 = 3
    2 + 3 = 5
    3 + 4 = 7
    4 + 5 = 9
    5 + 6 = 11
    6 + 7 = 13
    7 + 8 = 15
    These are the results of the second loop:
    0 + 1 = 1
    1 + 2 = 3
    2 + 3 = 5
    3 + 4 = 7
    4 + 5 = 9
    5 + 6 = 11
    6 + 7 = 13
    7 + 8 = 15
    [[email protected] robert]$
    [/code]
  • Yeah, I see what went wrong. The compiler I'm using is Miracle C. I had just recently reinstalled and forget to show the program where the include files were. *slaps forehead*
  • : Yeah, I see what went wrong. The compiler I'm using is Miracle C. I had just recently reinstalled and forget to show the program where the include files were. *slaps forehead*
    :
    I tried MiracleC some time ago, on my Winows computer. Correct me if I'm wrong, but isn't it a dos compiler with a windows IDE? honestly, I think you would like Turbo C better. Even if you just used the commandline compiler and used notepad to write with, I think you'd like the results. TC is a full compiler, no missing .h's. It's 16 bit, but so is Miracle. Now if you want a full 32 bit compiler with C++ capabilities, then DJGPP is one of the best choices. DJGPP is the dos port of the compiler I used in the last post. You'll have some downloading to do if you choose DJGPP, but it is worth it. TC is a little more managable. The zip will fit (with room left over) on a floppy.

  • [b][red]This message was edited by the TheNymph at 2002-5-22 11:27:31[/red][/b][hr]
    Basic, have you tried Microsoft's C++ compiler? How is it as far as a compiler goes?



  • : Basic, have you tried Microsoft's C++ compiler? How is it as far as a compiler goes?

    If you mean Visual C++, no I haven't. But, I hear good things about it. You can create gui's easily with it. It is microsoft though. It will cost you $$$.

    As far as a windows compiler goes, I'd recommend borland C++. The commandline compiler version is free, but no resource editor. Still it's about the best deal out there.

    Oh! Look for LCC-Win32. It's a Windows C (not ++) compiler, with a resource editor and IDE. It's also free. I haven't tried it yet.

  • :
    : : Basic, have you tried Microsoft's C++ compiler? How is it as far as a compiler goes?
    :
    : If you mean Visual C++, no I haven't. But, I hear good things about it. You can create gui's easily with it. It is microsoft though. It will cost you $$$.
    :
    : As far as a windows compiler goes, I'd recommend borland C++. The commandline compiler version is free, but [red]no resource editor[/red]. Still it's about the best deal out there.
    :
    : Oh! Look for LCC-Win32. It's a Windows C (not ++) compiler, with a resource editor and IDE. It's also free. I haven't tried it yet.
    :
    :
    [blue]If you look on the Web - you can find the Borland Resource Workshop - I think it is still very good.[/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories