Mail Archives: djgpp/1997/04/17/17:57:42
> I've just installed a version of DJGPP, but when I trie to compile
> some source, like the one below I get a message that cc1plus.exe is
> missing and that the installation was incomplete. Can anybody help me
> or sent me this file???
You probably just installed the basic C compiler support. If you want to
compile c++ files you will also need to get the DJGPP C++ package
(available from the same place you got the other parts, read the FAQ
or readme for details about the names).
To get this program to compile as c do this.
1) Make sure the extension is .c, not cc or cpp
2) Some code changes are needed
>
> #include <stdio.h>
>
> main()
int main(void)
{
> { printf("Input 2 digits: ");
> int a, b, som, verschil, u, v;
/* in c we declare stuff at the beginning of blocks */
int a, b, som, verschil, u, v;
/* io is buffered so use \n, or fflush */
printf("Input 2 digits: \n");
> scanf("%d %d", &a, &b);
> som = a + b, verschil = a - b
> u = som * som , v = verschil * verschil;
> printf("\nDe uitkomten zijn %d en %d.\n", u, v);
> }
- Raw text -