Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dev C++ to compile C source file

Tags:

c

dev-c++

How can I use Dev C++ to compile C source file. I thought it would automatically do it, but for some reason it compiles with several errors and I think its because you have to make changes for it to compile a C file.

Example test code:

 #include <stdio.h>



main ()        
{ int i,j;
double x,x_plus_one();
char ch;

i = 0;
x = 0;

printf (" %f", x_plus_one(x));
printf (" %f", x);

j = resultof (i);

printf (" %d",j);
}


double x_plus_one(x)          

double x;

{
  x = x + 1;
  return (x);
}


resultof (j)             

int j;

{
   return (2*j + 3);       
}
like image 899
TStamper Avatar asked Aug 23 '26 22:08

TStamper


1 Answers

Change main to int main() as well. And Do the modification as Neil pointed out.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!