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...
Type: Posts; User: Anubis
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...
can you post your updated code?
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[])
{...
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...
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>...
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...
You just need to pass your stream by reference.
int loadfile(ifstream &file);
Try this,
void run(std::string mystring);
I agree with you ahluka. There are some here that are just mindless jackasses. :mad:
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...
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...
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.
...
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 :...
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();
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,
...
Maybe ">>"
cin << problems;
Spelling?
switch (Problems)
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...
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...
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,...
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;...
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,...
Yes that is what I had in mind thank you.
Thank you very much Hunter2.
I want to thank everyone for all the help.
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...
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...
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...