Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How do I learn C with Eclipse?
How do I learn C with Eclipse? [message #902106] Wed, 15 August 2012 21:06 Go to next message
Cabhan Listis is currently offline Cabhan ListisFriend
Messages: 1
Registered: August 2012
Location: Maine, United States
Junior Member
I bought a book, Absolute Beginner's Guide to C, and got Eclipse up and running. But some of the code between that book and the Juno release of Eclipse seems a little off. My book is copyright 1994, so I was wondering if C has changed since then?

I'm just learning how to program, and tell me if I'm off, but it seems like there may be a few variations between IDEs or C?

For example, the help file, "Creating your C++ file" from "C/C++ Development User Guide > Getting Started" gives the code:

#include <iostream>
using namespace std;

int main () {
    // Say Hello five times
    for (int index = 0; index < 5; ++index)
      cout << "HelloWorld!" << endl;
    char input = 'i';
    cout << "To exit, press 'm'" << endl;
    while(input != 'm') {
        cin  >> input;
        cout << "You just entered " << input
             << " you need to enter m to exit." << endl;
    }
    exit(0);
}



And it took me a few weeks to figure out that "exit" was wrong. It only worked when I changed it to "return".

Is there a C primer/guide I can start with because some of the code from my book works and some do not.
Re: How do I learn C with Eclipse? [message #902569 is a reply to message #902106] Sat, 18 August 2012 13:37 Go to previous messageGo to next message
lifu xu is currently offline lifu xuFriend
Messages: 14
Registered: August 2012
Junior Member
楼主你放弃吧
煞笔太多
都不会
Re: How do I learn C with Eclipse? [message #902574 is a reply to message #902106] Sat, 18 August 2012 14:32 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
Quote:
I bought a book, Absolute Beginner's Guide to C
...
For example, the help file, "Creating your C++ file"


You should know, that C and C++ are different languages:

http://en.wikipedia.org/wiki/C_%28programming_language%29

http://en.wikipedia.org/wiki/C%2B%2B

You created an C++ example and therefore the "Hello World" code is different to the examples in your C book. Create a C project in Eclipse/CDT.

If you have problem starting with CDT, read:

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_o_home.htm

regards,
Klaus


Re: How do I learn C with Eclipse? [message #905313 is a reply to message #902574] Thu, 30 August 2012 06:34 Go to previous message
end829 end829 is currently offline end829 end829Friend
Messages: 1
Registered: August 2012
Junior Member
greats
Previous Topic:Linker options
Next Topic:Detect the selected word inside a treeviewer cell
Goto Forum:
  


Current Time: Tue Oct 15 01:21:45 GMT 2024

Powered by FUDForum. Page generated in 0.05802 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top