Thread: getting started

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    16

    Arrow getting started

    sorry about this very basic question...I have just started a first level C++ class and part of my homework is to write a simple program. Having done that on paper, I am having trouble translating it onto the computer. I have Microsoft Visual C++ 6.0 on my home computer ( no network) I have followed the typed instructions from the instructor up to the point of setting active project configuration. But I can't seem to get my workspace to open to a blank page. The best I can do is a blank text file. Is there a trick to doing this? Any help would be greatly appreciated for this "worse than novice" c++ student.

  2. #2
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    I thought MSVC++ was suppose to be easy to use.
    File->New->Win32 Console Application
    Fill in the fields Project Name and Location
    Make sure it's an empty project
    click OK, finish, OK
    File->New->C++ Source File
    Fill in the field File name

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    16
    Thank you, thank you , thank you...after I posted the question, I realized that the class professor did not instruct on the C++ source file. that is the step that I skipped.

    By the way, in this version of C++ are the standard header files, such as iostream included? I compiled the program I wrote and keep getting this error: :\Program Files\Microsoft Visual Studio\MyProjects\names\namesprogram.cpp(15) : error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the pre
    defined operator

    I am writing a cout statement and have included #include <iostream>

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    That error sounds like you're trying to read in (through >>) a type which is not recognized.

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    8
    It sounds like you got your >> and << mixed up. Like cout>> instead of cout<<.

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    16
    this is a very basic program...trying to display the first, middle, and last name on 3 separate lines from the user input of their name in John Jay Smith format. The final line should be their initials...which is a part of the program I am still working on...

    output should read:
    John
    Jay
    Smith
    JJS

    #include <iostream>

    using namespace std;

    int main ()
    {
    string firstName; // holds first name
    string middle; // holds middle name
    string lastName; // holds last name

    cout << "Enter your entire name: first, middle & last" << endl;
    cin >> firstName >> middle >> lastName;
    cout << firstName << endl;
    cout << middle << endl;
    cout << lastName << endl;

    return 0;
    }

  7. #7
    Registered User
    Join Date
    Oct 2001
    Posts
    8
    You need to include the string header file. So right after #include <iostream> put #include <string>

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    16

    Smile

    thanks. I really appreciate the feedback...class tonight was enlightening...I'm sure I will be posting again soon! Thanks again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help getting started :(
    By blackocellaris in forum C Programming
    Replies: 4
    Last Post: 11-05-2006, 06:50 PM
  2. Getting started
    By panzeriti in forum Game Programming
    Replies: 3
    Last Post: 06-28-2003, 10:13 AM
  3. Getting Started
    By UnclePunker in forum Game Programming
    Replies: 3
    Last Post: 04-11-2003, 12:34 PM
  4. How to get started?
    By anoopks in forum Linux Programming
    Replies: 0
    Last Post: 01-14-2003, 03:48 AM
  5. Need help getting started
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2001, 11:08 PM