Search:

Type: Posts; User: pandadc

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    1,750

    Pushback a vector

    How would you add a vector to the end of the collection of vectors of a class?
    like..
    trees is a class




    vector <trees> a;
    vector <trees> b;
  2. Replies
    8
    Views
    1,187

    Cut off Extra data

    If you had something like this:



    int age;
    string firstname;

    cout << "Please enter in your age and first name:";
    cin >> age >> firstname;
  3. Replies
    1
    Views
    1,346

    Check if an Integer

    In main()
    say you have something like this:




    int main(){

    int a;
  4. Replies
    25
    Views
    33,961

    atoi() equivalent in C++

    I know that :


    int atoi ( const char * string );

    atoi() converts a string to an integer in C programming.

    Is there an equivalent in C++ programming?
  5. Replies
    2
    Views
    1,118

    i just figured it out! thanks!

    i just figured it out! thanks!
  6. Replies
    2
    Views
    1,118

    Reprompt File Request

    My code reads something like


    ifstream fin;

    cout << "enter filename:";
    cin >> filename;

    a = OpentheFile(filename, fin);
  7. Replies
    2
    Views
    2,672

    Getline dealing with integers

    Say you have a file formatted like this (name, phone number):

    Joe Smith, 9019809923
    Greg Jones, 9019867823

    and you use getline to read in the each line then push it into a vector of strings.
    ...
  8. Replies
    8
    Views
    4,211

    awesome twomers, thanks for the help! I figured...

    awesome twomers, thanks for the help! I figured it out.
  9. Replies
    8
    Views
    4,211

    This is what I have so far: cout

    This is what I have so far:


    cout << "Please enter some text." << endl;

    getline(cin, usertext, '.');
    int end = 0;
    int start = 0;
  10. Replies
    8
    Views
    4,211

    Break Up Getline

    Hello All,
    Is there anyway to break up getline by 'spaces' and insert each word into a vector?
    I have the user stop at '.'. My code is as follows - it just inserts the whole string into a vector. ...
Results 1 to 10 of 10