Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 11-12-2007, 09:14 PM   #1 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Question Compilers For C And C++ ?


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 .
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 11-12-2007, 09:22 PM   #2 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

forget it.Download devc++,its easy to use and lightweight.And I suggest you try out Linux for your programming needs.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 09:40 PM   #3 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

#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
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Old 11-12-2007, 09:43 PM   #4 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

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.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 09:46 PM   #5 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Compilers For C And C++ ?

Yeah just omit conio.h, clrscr(); and getch();

Code:
#include <stdio.h>
int main()
{
printf("asssignment 1");
}
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 11-12-2007, 09:46 PM   #6 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

in dev c++

'main' must return int

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

`clrscr' undeclared (first use this function)
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Old 11-12-2007, 09:50 PM   #7 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Compilers For C And C++ ?

Use the above given code sample.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 11-12-2007, 09:52 PM   #8 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

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
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer

Last edited by clmlbx; 11-12-2007 at 09:52 PM. Reason: Automerged Doublepost
clmlbx is online now  
Old 11-12-2007, 09:52 PM   #9 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

^^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++
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 09:54 PM   #10 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Compilers For C And C++ ?

Quote:
Originally Posted by clmlbx
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.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 11-12-2007, 09:57 PM   #11 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

this was told by my teacher

books are provided by aptech
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer

Last edited by clmlbx; 11-12-2007 at 09:57 PM. Reason: Automerged Doublepost
clmlbx is online now  
Old 11-12-2007, 09:58 PM   #12 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Compilers For C And C++ ?

Sigh, get Turbo C++ from your college/school/windows_users_at_digit and go on, be a part of the unproductive coders.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 11-12-2007, 09:59 PM   #13 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

in turbo c++ also i have three errors
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Old 11-12-2007, 09:59 PM   #14 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

^^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.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 10:01 PM   #15 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: Compilers For C And C++ ?

@clmblx Ur teacher doesnt use dev c++ then ..
btw for the return error add a
return 0;
before the code ends..
Pathik is offline  
Old 11-12-2007, 10:04 PM   #16 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

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
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer

Last edited by clmlbx; 11-12-2007 at 10:04 PM. Reason: Automerged Doublepost
clmlbx is online now  
Old 11-12-2007, 10:05 PM   #17 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

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.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 10:06 PM   #18 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

any help or hint for

how to write programme for even and odd

greater in 3 numbers using switch
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Old 11-12-2007, 10:16 PM   #19 (permalink)
die blizzard die! D3?
 
The_Devil_Himself's Avatar
 
Join Date: Aug 2007
Location: Event horizon
Posts: 2,361
Default Re: Compilers For C And C++ ?

^^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.
__________________
Stealing your women and horses since 1843.
The_Devil_Himself is offline  
Old 11-12-2007, 10:22 PM   #20 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

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)
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer

Last edited by clmlbx; 11-12-2007 at 10:22 PM. Reason: Automerged Doublepost
clmlbx is online now  
Old 12-12-2007, 01:33 AM   #21 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: Compilers For C And C++ ?

Quote:
Originally Posted by QwertyManiac
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.
__________________
http://www.bash.org/?258908

Last edited by mehulved; 12-12-2007 at 01:33 AM. Reason: Automerged Doublepost
mehulved is offline  
Old 12-12-2007, 02:21 AM   #22 (permalink)
The Lord of Death
 
Yamaraj's Avatar
 
Join Date: May 2005
Location: यमलोक
Posts: 253
Default Re: Compilers For C And C++ ?

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.
Yamaraj is offline  
Old 14-12-2007, 04:46 PM   #23 (permalink)
C# Be Sharp !
 
Zeeshan Quireshi's Avatar
 
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
Default Re: Compilers For C And C++ ?

Quote:
Originally Posted by clmlbx
in turbo c++ also i have three errors
Here , this is the solution for you:

Ditch Turbo C++ use Relo !
__________________
There are 10 types of people in the world: those who understand binary and those who do not.
Zeeshan Quireshi is offline  
Old 15-12-2007, 10:07 AM   #24 (permalink)
Wise Old Owl
 
clmlbx's Avatar
 
Join Date: Aug 2006
Location: Indore
Posts: 1,687
Default Re: Compilers For C And C++ ?

^^^ I got the solution .. It was directory errors. directories were not defined correctly

thanx
__________________
Athlon II X4 635 @ 2.9Ghz   Gigabyte GA-MA785GMT-US2H   Kingston 2x2 Gb 1333Mhz DDR3   WDC 500Gb Green   Palit GTS 250 512mb   Tagan 500W   Samsung B2030   Lg DVD Writer
clmlbx is online now  
Old 25-01-2008, 05:46 PM   #25 (permalink)
Apprentice
 
Join Date: Jan 2005
Location: Faridabad
Posts: 66
Default Re: Compilers For C And C++ ?

visual studio 2008 express edition Just give it a try your search would be over.
__________________
Sudhir Mangla
http://DevelopersVoice.com
(VC++ FAQ, MFC FAQ, C++ FAQ)
http://Programmerworld.net
(Free books and source code)
sudhir_mangla is offline  
Old 25-01-2008, 09:17 PM   #26 (permalink)
Elevating Humanity
 
The Conqueror's Avatar
 
Join Date: Sep 2007
Location: Now on Earth
Posts: 1,954
Default Re: Compilers For C And C++ ?

Also bloodshed dev c++ is good
visual studio 08 roxx
__________________
Regards,
The Conqueror
The Conqueror is offline  
Old 25-01-2008, 10:17 PM   #27 (permalink)
In The Zone
 
anand1's Avatar
 
Join Date: Sep 2007
Location: 23 17'N, 86 05'E
Posts: 369
Default Re: Compilers For C And C++ ?

Yes go for DevC++ i have been using it and never had any problem. It is light and eats up less memory.
__________________
Technology On The Fly
anand1 is offline  
Old 25-01-2008, 10:38 PM   #28 (permalink)
Wise Old Owl
 
The Unknown's Avatar
 
Join Date: Nov 2006
Location: Pune, Maharashtra, India
Posts: 1,728
Default Re: Compilers For C And C++ ?

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.
__________________
KDE on ArchLinux
PHP, MySQL, PostgreSQL, Linux, Apache; Message me to hire (freelancing only)
Explore Technology @ http://www.itech7.com
Cheap and Reliable VPS Hosting @ http://j.mp/arHk5e
The Unknown is offline  
Old 25-01-2008, 11:41 PM   #29 (permalink)
Fresh Stock Since 2005
 
Join Date: Feb 2005
Posts: 1,015
Default Re: Compilers For C And C++ ?

Quote:
Originally Posted by clmlbx View Post
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:


and when you press enter, it shows:


post the details here, if you cant figure out urself......
__________________
http://www.khattam.info
khattam_ is offline  
Old 25-01-2008, 11:45 PM   #30 (permalink)
C# Be Sharp !
 
Zeeshan Quireshi's Avatar
 
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
Default Re: Compilers For C And C++ ?

Quote:
Originally Posted by anand1 View Post
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 .
__________________
There are 10 types of people in the world: those who understand binary and those who do not.
Zeeshan Quireshi is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ compilers for win xp x64 setharsh Software Q&A 5 22-12-2006 02:25 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2