Raised This Month: $51 Target: $400
 12% 

C / C++ Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jheshka
Senior Member
Join Date: Dec 2005
Old 02-23-2009 , 12:22   C / C++ Problem
Reply With Quote #1

So I'm using notepad++ to create some c applications for a school course, and cygwin to compile them.


I've had no problems what-so-ever. Until now.
I've reached Chapter 8, which is based on classes.


I've had no trouble with anything else, but I haven't been able to find the proper syntax for a C class.

My teacher has just advised me to use the g++ compiler and use the C++ method of classes for the next few exercises.




And I've done that, but I'd really like to know what I was doing wrong with the original.


Thanks
__________________
James
Jheshka is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-23-2009 , 12:37   Re: C / C++ Problem
Reply With Quote #2

Quote:
Originally Posted by Jheshka View Post
So I'm using notepad++ to create some c applications for a school course, and cygwin to compile them.


I've had no problems what-so-ever. Until now.
I've reached Chapter 8, which is based on classes.


I've had no trouble with anything else, but I haven't been able to find the proper syntax for a C class.

My teacher has just advised me to use the g++ compiler and use the C++ method of classes for the next few exercises.




And I've done that, but I'd really like to know what I was doing wrong with the original.


Thanks
C doesn't have classes.
joaquimandrade is offline
Jheshka
Senior Member
Join Date: Dec 2005
Old 02-23-2009 , 12:55   Re: C / C++ Problem
Reply With Quote #3

You've got to be kidding me...
/facepalm


That's what I get for using a java text book to do C
__________________
James
Jheshka is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-23-2009 , 13:12   Re: C / C++ Problem
Reply With Quote #4

Quote:
Originally Posted by Jheshka View Post
You've got to be kidding me...
/facepalm


That's what I get for using a java text book to do C
You have pointers, structs and function pointers. You can create with them something close to a class. Anyway it is a different concept and the fact is that there aren't classes in C.

Last edited by joaquimandrade; 02-23-2009 at 13:19.
joaquimandrade is offline
Sean D
Junior Member
Join Date: Apr 2006
Old 02-23-2009 , 22:03   Re: C / C++ Problem
Reply With Quote #5

Quote:
Originally Posted by Jheshka
using a java text book to do C
...how do you do that?
Sean D is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-23-2009 , 22:17   Re: C / C++ Problem
Reply With Quote #6

Quote:
Originally Posted by Sean D View Post
...how do you do that?
........ It's pretty self explanatory.....

Edit: Yes, all those periods were necessary.
BOYSplayCS is offline
Jheshka
Senior Member
Join Date: Dec 2005
Old 02-24-2009 , 14:56   Re: C / C++ Problem
Reply With Quote #7

Quote:
Originally Posted by Sean D View Post
...how do you do that?
By taking a java course, and using the text book so I can get the assignments and exercises, but completing them in C.
__________________
James
Jheshka is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 02-24-2009 , 15:53   Re: C / C++ Problem
Reply With Quote #8

Just to clarify ... The "C++" in the topic title was entirely erroneous, no?

Sounds like you're doing good old-fashioned C to me.
If you want classes, learn/write/compile C++

And you can get C compilers for Windows, you don't really need Cygwin just for gcc, do you?
(Or do you already have Cygwin)
purple_pixie is offline
Jheshka
Senior Member
Join Date: Dec 2005
Old 02-25-2009 , 08:33   Re: C / C++ Problem
Reply With Quote #9

Already had Cywgin. I know about the GNU compiler and other compilers.
__________________
James
Jheshka is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 06:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode