DIGIT-ARC read-only archive · snapshot: July 23, 2026

Compilers For C And C++ ?

32 posts · originally from https://geek.digit.in/community/threads/compilers-for-c-and-c.75447/

clmlbx
clmlbx Original post #1
Dec 11, 2007 at 9:14 PM
OK GUYS, I just joined aptech for c & c++. now to complete my assignment i need a compiler .( which is light and of complete use ). I installed microsoft c++ express edition ..but how to use it ............u sudgest me good compiler or tell me how to use that c++ express edition from microsoft .
The_Devil_Himself
Dec 11, 2007 at 9:22 PM
forget it.Download devc++,its easy to use and lightweight.And I suggest you try out Linux for your programming needs.
clmlbx
clmlbx #3
Dec 11, 2007 at 9:40 PM
#include <conio.h>
#include <stdio.h>
void main()
{
clrscr();
printf("asssignment 1");
getch();
}

is there any thing wrong in it ?

I am getting 3 errors
The_Devil_Himself
Dec 11, 2007 at 9:43 PM
which compiler?

Lemme guess the errors:
1.conio.h is not defined something
2.error about clrscr()
3.getch()

conio.h is not a part of standard ISO c\c++ standards.and both clrscr and getch are defined in conio.h.
QwertyManiac
Dec 11, 2007 at 9:46 PM
Yeah just omit conio.h, clrscr(); and getch();

Code:
#include <stdio.h>
int main()
{
printf("asssignment 1");
}
clmlbx
clmlbx #6
Dec 11, 2007 at 9:46 PM
in dev c++

'main' must return int

In function `int main(...)':

`clrscr' undeclared (first use this function)
QwertyManiac
Dec 11, 2007 at 9:50 PM
Use the above given code sample.
clmlbx
clmlbx #8
Dec 11, 2007 at 9:52 PM
ok that is working but for other programes

wont it make any problem

so conio.h will not work in dev c++

any other compiler
The_Devil_Himself
Dec 11, 2007 at 9:52 PM
^^was this code told to you by your teachers?Or you just made it yourself?Which book are you using?


forget this compiler ratting devc++ is very good.


Programming in standard c\c++
QwertyManiac
Dec 11, 2007 at 9:54 PM
clmlbx said:
so conio.h will not work in dev c++
conio.h is not standard C. Its a part of dinosaur C which devs back in 80s probably used.
clmlbx
clmlbx #11
Dec 11, 2007 at 9:57 PM
this was told by my teacher

books are provided by aptech
QwertyManiac
Dec 11, 2007 at 9:58 PM
Sigh, get Turbo C++ from your college/school/windows_users_at_digit and go on, be a part of the unproductive coders.
clmlbx
clmlbx #13
Dec 11, 2007 at 9:59 PM
in turbo c++ also i have three errors
The_Devil_Himself
Dec 11, 2007 at 9:59 PM
^^then tell your bloody teachers to teach you standard c\c++.OR just forget them all and learn yourself.

There are thousands of good tutorials available on net to get you started.
Pathik
Pathik #15
Dec 11, 2007 at 10:01 PM
@clmblx Ur teacher doesnt use dev c++ then .. :p
btw for the return error add a
return 0;
before the code ends..
clmlbx
clmlbx #16
Dec 11, 2007 at 10:04 PM
i remember he uses turbo c++

in turbo c++ errors are

include conio.h and stdio.h can not be open

unable to create .obj file
The_Devil_Himself
Dec 11, 2007 at 10:05 PM
turbo c++ was last launched in 1992!!! and c\c++ was standardized in 1998 iirc.

what aptech\your teachers are teaching you is not standars c\c++ which all the devs around the world use.


@errors in turbo c++:you have to specify the directry of header files in some setting iirc.Dude trust us and stop using turbo.
clmlbx
clmlbx #18
Dec 11, 2007 at 10:06 PM
any help or hint for

how to write programme for even and odd

greater in 3 numbers using switch
The_Devil_Himself
Dec 11, 2007 at 10:16 PM
^^lol.we can't teach you every program boy.Make good use of your net connection.

anyways how to check for even,odd:

let the no. to be tested is n,then if n%2==0 then the no. n is even otherwise not.

%=remiander,i.e. for e.g. 5%2=1,7%5=2,4%2=0.
'==' duble = means comparision.
clmlbx
clmlbx #20
Dec 11, 2007 at 10:22 PM
i knew how to do it but i was little confused ..

hey any one know why i am getting that errors in turbo c++

(post no. 16)
M
mehulved #21
Dec 12, 2007 at 1:33 AM
QwertyManiac said:
Yeah just omit conio.h, clrscr(); and getch();

Code:
#include <stdio.h>
int main()
{
printf("asssignment 1");
}
Shouldn't it be returning an int?
I believe you should either add
Code:
return 0
or
Code:
main
instead of int main.
Though this won't give an error but I believe it should give warning if you pass -Wall parameter to gcc.

Didn't I warn of the morons at aptech? Forget aptech they will teach you just crap.
Yamaraj
Yamaraj #22
Dec 12, 2007 at 2:21 AM
Code:
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    (void) printf("asssignment 1");

    return EXIT_SUCCESS;
}
This code conforms to the ANSI/ISO C standards, and can withstand all syntax checker programs (lint), as well as -Wall -ansi -pedantic parameters to the GCC C compiler.
Zeeshan Quireshi
Dec 14, 2007 at 4:46 PM
clmlbx said:
in turbo c++ also i have three errors

Here , this is the solution for you:

*www.thinkdigit.com/forum/showthread.php?t=65520
clmlbx
clmlbx #24
Dec 15, 2007 at 10:07 AM
^^^ I got the solution .. It was directory errors. directories were not defined correctly

thanx
S
Jan 25, 2008 at 5:46 PM
visual studio 2008 express edition Just give it a try your search would be over.
T
The Conqueror #26
Jan 25, 2008 at 9:17 PM
Also bloodshed dev c++ is good
visual studio 08 roxx
anand1
anand1 #27
Jan 25, 2008 at 10:17 PM
Yes go for DevC++ i have been using it and never had any problem. It is light and eats up less memory.
nileshgr
nileshgr #28
Jan 25, 2008 at 10:38 PM
you want clear screen. use the following code:

Code:
#include <stdio.h>
#include <stdlib.h>

void clrscr()
{
system("clear");
}

int main()
{
clrscr();
printf("asssignment 1\n\n");
}

I have tried this using g++ but i can't guarantee that it will work on Windows. :)
K
khattam_ #29
Jan 25, 2008 at 11:41 PM
i knew how to do it but i was little confused ..

hey any one know why i am getting that errors in turbo c++

(post no. 16)

turbo c++ shows error details... on compiling..... Ctrl+F9

like this:
*geocities.com/khattam_khattam/tcerr1.jpg

and when you press enter, it shows:
*geocities.com/khattam_khattam/tcerr2.jpg

post the details here, if you cant figure out urself......
Zeeshan Quireshi
Jan 25, 2008 at 11:45 PM
Yes go for DevC++ i have been using it and never had any problem. It is light and eats up less memory.
Man VC++ 2008 Express Edition pwns DevC++ , just have a look at it n then tell .
j1n M@tt
j1n M@tt #31
Jan 25, 2008 at 11:58 PM
Use Broland 32-bit C++ Compiler......its free,light on resource,easy to understand and best suited for C/C++ project works......all of our group's works(Centium inc.) r done on this IDE.
nileshgr
nileshgr #32
Jan 26, 2008 at 7:25 AM
@the question asker,
if you can't spare clear screen which is included in conio.h then

include stdlib.h && instead of clrscr(); use system("clear");

:)