Search:

Type: Posts; User: Anubis

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    2,899

    You need to post all the code that is getting...

    You need to post all the code that is getting used before this. I am going to say you used cin someplace before this bit of code. If you did search for mixing cin and getline and post back with any...
  2. Replies
    11
    Views
    1,752

    can you post your updated code?

    can you post your updated code?
  3. Replies
    7
    Views
    1,597

    Is there a reason you are using double quotes? If...

    Is there a reason you are using double quotes? If not try #include <iostream.h>
    Also printf is in "stdio".
    So maybe,

    #include "stdafx.h"
    #include <stdio.h>
    int main(int argc, char* argv[])
    {...
  4. Thread: c++ questions

    by Anubis
    Replies
    3
    Views
    965

    I would say you are wrong. After the first...

    I would say you are wrong.
    After the first statement "j" has the value of 15.
    Now the second statement "k" has the value 15 because "j" just changed in the above statement.
    Last "j" has the value...
  5. Replies
    2
    Views
    854

    You can just use "getline" the version for use...

    You can just use "getline" the version for use with the "string class". Just use the '%' and '#' as delimiters. You could also use "getline" with 'x' to get the numbers to.


    #include <fstream>...
  6. Replies
    8
    Views
    1,593

    A good stating place for "what should be done...

    A good stating place for "what should be done next" is to have code that if possible will compile.

    This is an array of 100 strings. Not a string with a 100 characters. Is that what you really...
  7. Replies
    12
    Views
    3,027

    You just need to pass your stream by reference. ...

    You just need to pass your stream by reference.

    int loadfile(ifstream &file);
  8. Replies
    3
    Views
    1,372

    Try this, void run(std::string mystring);

    Try this,

    void run(std::string mystring);
  9. Thread: Apologies

    by Anubis
    Replies
    55
    Views
    9,604

    I agree with you ahluka. There are some here that...

    I agree with you ahluka. There are some here that are just mindless jackasses. :mad:
  10. Replies
    14
    Views
    1,338

    Well you are just as stupid as major_small....

    Well you are just as stupid as major_small. Clearly if you can read,
    it has a link to an example at bottom.


    You are must have a major small brain.


    Well my conclusion that you do not know...
  11. Replies
    14
    Views
    1,338

    I'm sorry, but are your post alway so pointless....

    I'm sorry, but are your post alway so pointless.
    I will not argue the value of the link I posted. If you wish to post another link fine. But you should be a little more open minded. If everyone...
  12. Replies
    14
    Views
    1,338

    This is a link for getline,...

    This is a link for getline,
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrf_string_getline_class.asp

    You might want to add some debugging statements.
    ...
  13. Thread: Function Help

    by Anubis
    Replies
    3
    Views
    873

    void did not make the difference in it working or...

    void did not make the difference in it working or not working. The problem was you had your functions in main you can not define a function inside a function.

    Function header,
    Example :...
  14. Thread: Function Help

    by Anubis
    Replies
    3
    Views
    873

    You function stuff is wrong. Move it outside of...

    You function stuff is wrong. Move it outside of main and make them void.

    #include <iostream>

    using namespace std;


    void mMenu();
    void playgame();
    void about();
  15. Replies
    31
    Views
    3,186

    Yes, but it is probably not your intention? ...

    Yes, but it is probably not your intention?


    The previous post has your answer. If not at least something worth pursuing and fixing.


    Ok add this to main just before your call to fight,
    ...
  16. Replies
    31
    Views
    3,186

    Maybe ">>" cin

    Maybe ">>"

    cin << problems;
    Spelling?

    switch (Problems)
  17. Replies
    6
    Views
    1,435

    The problem is the variables y and z in your...

    The problem is the variables y and z in your function "Runme" are just copys of y and z from main, not the originals. To modify the variables like you are asking one way would be to pass them by...
  18. Thread: Cin.get()

    by Anubis
    Replies
    4
    Views
    922

    Since you did not post any code I will guess and...

    Since you did not post any code I will guess and say add "cin.ignore()".
    This is a common question. A search of the board would probably give more of a explanation. But here are some examples.
    This...
  19. Replies
    5
    Views
    3,560

    The faq's are here,...

    The faq's are here,
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
    Maybe this,
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385
    and this,...
  20. Long story short you did not allow for the null...

    Long story short you did not allow for the null terminating character '\0'.

    mytext = new char[count+lenght];
    maybe,

    mytext = new char[(count+lenght)+1];
    and

    for (int i = 0; i < lenght;...
  21. Thread: Please help me.

    by Anubis
    Replies
    14
    Views
    1,267

    The first thing you are missing is, #include...

    The first thing you are missing is,

    #include <string>
    Then you will also need to put "sales.txt" between double quotes,

    ifstream infile ("sales.txt");
    You also are missing a semicolon here,...
  22. Yes that is what I had in mind thank you. ...

    Yes that is what I had in mind thank you.


    Thank you very much Hunter2.


    I want to thank everyone for all the help.
  23. That should do the trick I had not considered...

    That should do the trick I had not considered using new and delete.


    Thanks for the concern (not being sarcastic but sincere). It was just a quick example to reproduce my problem so I neglected...
  24. How to enable a choice for what type of object to create?

    I am having trouble with how to go about implementing a way for there to be a choice of what kind of object to create from the two derived classes. I have tried something like this, but it gives me...
  25. Thread: Dont know why

    by Anubis
    Replies
    7
    Views
    1,283

    You are missing a closing brace at the end of the...

    You are missing a closing brace at the end of the function "void hotel::submenu()".

    cin>>continues;
    if(continues=='y'||continues=='Y')
    menu();
    }
    }// need a closing brace

    void...
Results 1 to 25 of 36
Page 1 of 2 1 2