Results 1 to 6 of 6

Thread: C++ help

  1. #1
    Splice The Main Brace Reputation: 467 TylerDurden's Avatar
    Join Date
    Feb 2008
    Location
    Home of the BumBot
    Posts
    1,950

    Default C++ help

    ill start out saying i just started taking a C++ class. i missed the first day, but he told me the homework was posted online, so im trying to do this homework, and its going good expect for the fact that i dont know where to run these programs im making. im using Visual Studio, and it keeps saying my program has errors, which cant be true. here is my program. is anything wrong with it ? If not, then it must be the program im using.

    // Problem 2.5
    # include <iostream>
    using namespace std;

    int main <>
    {

    cout << " hi\n";
    cout << " this is my program\n";
    return 0 ;

    }
    <i>"Praise the Lord and pass the ammunition!"</i>
    SELF-PITY
    I never saw a wild thing
    sorry for it's self.
    A small bird will drop frozen dead from a bough
    without ever having felt sorry for itself.
    - David Herbert Lawrence

  2. #2
    Seņor Member Reputation: 393
    Join Date
    Feb 2008
    Location
    Loco's Biatch
    Posts
    2,261

    Default Re: C++ help

    your program has errors. listen to what your compiler tells you, it knows better than you.

    also, visual studio what. there's a lot of visual studios, and trying to compile c++ under visual studio basic won't do you any good.

  3. #3
    Splice The Main Brace Reputation: 467 TylerDurden's Avatar
    Join Date
    Feb 2008
    Location
    Home of the BumBot
    Posts
    1,950

    Default Re: C++ help

    yeah i have visual basic 2008.

    i'll get visual C++...
    what i don't get is this. i took a program from the book that works, and put it in there, and it gave just about everything errors.

    how do i have errors in that ? !!!!!# sfidxguisdrhgserdtgwe4sruw4eithddgg4ttttttttt..... ...............
    <i>"Praise the Lord and pass the ammunition!"</i>
    SELF-PITY
    I never saw a wild thing
    sorry for it's self.
    A small bird will drop frozen dead from a bough
    without ever having felt sorry for itself.
    - David Herbert Lawrence

  4. #4
    Splice The Main Brace Reputation: 467 TylerDurden's Avatar
    Join Date
    Feb 2008
    Location
    Home of the BumBot
    Posts
    1,950

    Default Re: C++ help

    omg so silly. my program works from what visual C++ says. However i don't know how to view it. i went to "build" and it complied it and said it was good.
    <i>"Praise the Lord and pass the ammunition!"</i>
    SELF-PITY
    I never saw a wild thing
    sorry for it's self.
    A small bird will drop frozen dead from a bough
    without ever having felt sorry for itself.
    - David Herbert Lawrence

  5. #5
    Seņor Member Reputation: 393
    Join Date
    Feb 2008
    Location
    Loco's Biatch
    Posts
    2,261

    Default Re: C++ help

    press the green triangle button that looks like a tape recorder's "play" button.

    also, you will see a prompt pop up and instantly disappear since your program terminates as soon as it's done and doesn't wait for user input.

  6. #6
    Convinced of the Hex Reputation: 23 EMBAR's Avatar
    Join Date
    Feb 2008
    Location
    Akron, OH
    Posts
    193

    Default Re: C++ help

    You can navigate to your project's debug directory or release directory, whatever option you have in the drop down box at the top when viewing your project. Inside, after you've compiled, will be the .exe. Use cmd.exe to navigate to that directory and run the executable. This way the prompt will stay up after the program has executed.

    Edit: This is assuming VS2008 is like VS2005, what I've used most recently. Either way, depending on the project type you selected, there should be a .exe somewhere in your project folder or its subfolders.

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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