www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: C++ Compiler

  1. #1
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004

    C++ Compiler

    I know this is a Web Developers forum, but you guys are just so nice and helpful, I had to ask this here.


    I've decided to start learning C++, and I am in need of a compiler. So I was wondering if anyone here had any personal favorites, or knew of any particularly good ones?

    I've never done any programming before, so any help provided would be very much appreciated.
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  2. #2
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    I've only done very little work with C++ (when I say very little, I mean as in "Hello, World" little), and I think Bloodshed Dev-C++ is the best free one I've come accross so far. Good luck with everything.

  3. #3
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Actually, I did download that. And I Googled "C++ Tutorials" and clicked on this one here. www.cprogramming.com. Well, I follwed the instructions to the letter, 'cept I changed the text of course. And then I Compiled the file.

    I got a warning which said, "This file contains at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples including substituting the <X> header for the <X.h> for C++ includes, or <sstrea"

    The program won't run either. All it does is just display the text I've typed in. The window in which the program is supposed to be display flashes up for a split second, then just disappears... Puzzling indeed.
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  4. #4
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Eh, sorry, got the link wrong up there.

    www.cprogramming.com
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  5. #5
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    You need to add extra code for the window to stay open. You can either do that or run it from a command-line. If you want it to stay open after printing the text (or whatever else), add this to the top of your code:
    Code:
    #include <conio.h>
    Then, right before the closing curleybrace of main, use this function:
    Code:
    getch();
    Last edited by fredmv; 12-04-2003 at 12:21 AM.

  6. #6
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    I read what you said, then I tried this.

    Code:
    #include <conio.h>
    int main() {
    cout<<"Hello, World!";
    return 0;
    getch();
    }
    I got an error: " 'cout' undeclared (first use this function)"
    And my previous problem still occurrs...
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  7. #7
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    you will have to remember that C++ is a fairly low level proramming langugae,
    it typically does not automatically does things for you,you will have to let it know what to do.
    So in your case

    you are using a function cout but no declaring it or defining it anywhere,, Since its a library function for spitting data out,you will need to import the library file which is

    iostream.h

    so add this

    #include <iostream.h>
    #include <conio.h>
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  8. #8
    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    726
    lol.. kinda offtopic but I love programming... possibilities are endless and it just really appeals to me. Even though I have never tried it, I will try to start learning it soon, once i have a little more experience with PHP, my main goal ATM.
    Theres this thing called imperfection. Its the one thing everyones got but nobody wants.

    I.. HATE.. EVERYTHING ABOUT YOU! Why do.. I Love you? I HATE Everything about you! Why do I.. love you??? Everytime we lie awake... after every hit we take.. every feeling that i get.. but i haven't missed you yet. only when I stop to think about it... I.. HATE.. EVERYTHING ABOUT YOU! Why do.. I Love you? I HATE Everything about you! Why do I.. love you?

  9. #9
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Well, I still have the problem of the program not staying up... the window in which it should display just flickers up for a split second.


    Now, I tired something like this:
    Code:
    #include <iostream.h>
    #include <conio.h>			
    int main() {
    int age;
    cout<<"Your age here, please:";
    cin>>age;
    if(age<14) {
    cout<<"You are younger than I am.";
    }
    else if(age==15) {
    cout<<"You are my age!";
    }
    else {
    cout<<"You are older than I am.";
    }
    return 0;
    }
    And the program runs, asking for my age. But as soon as I type in my age and hit ENTER, the program closes.
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  10. #10
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Well, in an attempt to gain any knowledge of C++, I Googled it, hoping to find every and any arcticle and .txt I could find.

    I found this.
    I am having the same problem. The program closes as soon as the ENTER key is pressed.

    For a Compiler I'm using Dev-C++.
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  11. #11
    Join Date
    Nov 2003
    Posts
    655
    Slap this in right BEFORE the return statement:

    Code:
    cout << "\nPress enter to quit.";
    getch();

  12. #12
    Join Date
    Dec 2002
    Location
    WI, United States
    Posts
    1,372
    Originally posted by CardboardHammer
    Slap this in right BEFORE the return statement:

    Code:
    cout << "\nPress enter to quit.";
    getch();
    That didn't work for me, but try this:

    cout << "\nPress any key to continue" << endl;
    getche();

    Those should go right before the return statement...

    And my recommendation for a compiler is Visual C++ 6.0. The bottom line is it rocks and I've never seen anything that compares. The down side is that it is not free...
    if (succeed != true)
    function askAdam();

    Check out my site!

  13. #13
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Alright, thanks for your help, I'll see if that works.


    Adam,
    This Visual C++ 6.0, what's the price tag?
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  14. #14
    Join Date
    Dec 2002
    Location
    WI, United States
    Posts
    1,372
    Well, the new version of the Visual Studio is actually the .NET edition, but I don't like that as much for just plain old C/C++ programming. The .NET edition is really nice, too, but I prefer the 6.0 for C/C++. If I'm using VB, then I definately use .NET. As for the price, though, I think you can get the standard edition for just over $100 or so. If you buy it used, you might be able to get it for cheaper, I don't know...

    One more thing is if I were you I would check if you can get the academic edition, since it is much cheaper. As long as your still a student, you should be able to get it. It's not the easiest thing to find on their site, though, so you'll have to look around.
    if (succeed != true)
    function askAdam();

    Check out my site!

  15. #15
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Hmmmm... aight, I'll take a look at it, thanks.


    P.S., are home schoolers eligible for the academi edition?
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles