Beginners - August 2013 (Page 18)

Taking strings from overloaded std::cin
 
How would i code this? A simple program that accepts the user to put any amount of words in. They can ONLY enter words one time. The program will process ...
[9 replies] Last: What im looking for is something like a function that asks "Is cin em... (by cire)
user input, ignore space array of strings
 
Sorry if this has been asked before, I did search and found similar questions but none with an array of strings. I have a dynamically allocated array of stri...
[9 replies] Last: Thank you very much cire, that worked perfectly. (by l00kadiversion)
How to build proper release versions.
 
Hi. I am using Visual Studio 2010. To build a release version of my program, i simply have to change a simple build option from "debug" to "release". However...
[no replies]
Why Switch failing?
 
void handleKeypress(unsigned char key, int x, int y) { switch (key) { case 'a': if(selection == 0){//2nd Option xmove -= 7; if(xmove == -14){ xmove += 7...
[1 reply] : Did you forget a break; after line 6? Also... what do you mean by "... (by Disch)
Returning object from data member address
 
If you have the address of a data member of some class, is there a generic way to retrieve the unique object that has that address for this data member? Or do ...
[15 replies] Last: Neat. I didn't know that about deque. (by Disch)
Accessing Private Member Functions
 
Real quick question. Say I have the following code: class Base { public: // Some public shit private: int secret(); I then innitialise an o...
[4 replies] Last: Vlad to the rescue..again thanks man! (by Xistenial)
by etneri
Help with Linked Lists
 
I'm having trouble getting linked lists down. I have this piece of a realty company program that I want to display input from a file entitled "listings.txt". ...
[3 replies] Last: You need to allocate memory for the structure each time you read a new... (by vlad from moscow)
error: expected ; before username1
 
error: expected ; before username1. what seem the problem? ps i am a begginer #include <iostream> int main() { cout <<"Enter your username. ...
[3 replies] Last: bold is what I changed. Thsi should work for you now: #include <io... (by Stewbond)
by iamk2
Struct with its own input/output operators???
 
Natural C++ input loop is char Name; int StartSalary; int Age; ifstream indata; while( /* input operation, such as indata >> data */ ) { // pro...
[7 replies] Last: Thanks geek -been pounding the pages on overloaded operations and have... (by iamk2)
Previous declarations
 
I am using multiple ifstream loads and it claims to be prviously declared so it stops my compilation. What can i do about that?
[7 replies] Last: Ah okay. ^^ It would've been helpful if OP was a little more clear w... (by Disch)
Huge array error
 
So i was working on a program and made an array like this : int position ; And, this doesn't seem to work :S any ideas on how to make it run? I a...
[5 replies] Last: what compiler do you use? and how much RAM does the pc have? if you d... (by theblackdog)
STring to int
 
How do you convert a string to an int if the string is a number?
[12 replies] Last: Are you using a text file to store variable data in an attempt to crea... (by Manga)
Pig_latin program.
 
I stuck at main function. I don't know how to address user input to main(int argc, char *argv ). user's input by ./pig_latin button .output: uttonbay. Any help ...
[3 replies] Last: line 75 should be int or unsigned int ? (by Smac89)
Allocating memory?
 
I have used a line of code (fstream load) to much and now my program won't compile. Is there anyway i can allocate memory to the line of code?
[2 replies] Last: I overloaded the ifstream load function. Overload being i used it too ... (by closed account NUj6URfi)
Need help with this snake game
 
snake game
[2 replies] Last: Insert a breakpoit at line 82 and check which position is falling outs... (by Jaybob66)
Classes
 
This may be a dumb question, but I don't see the point of classes. I know that inheritance would help alot with coding time and what not, but other than that I...
[7 replies] Last: I remember I used to think the same thing: "Why use classes? Just the... (by IWishIKnew)
change the data of 2 rows of an array
 
How can I change the data of 2 rows of an array using the swap. I write the basic change code but i want to improve performance by changing it into one line (us...
[3 replies] Last: for (int i = 0; i < COLS; ++i) std::swap(iArr[row1 - 1]... (by Cubbi)
how to make a quit statement?
 
i mean how to quit the program in few seconds?? is it about using the sleep?? please give me an answer... appreciate your answer!
[2 replies] Last: oh i see! thank you. i was still cracking my head about the library. :... (by cheng412)
Not declared in scope...
 
I have wrote a simple average calculation program trying to calculate a semester average. When I compile the code I get an error telling me my 'inputExam' funct...
[2 replies] Last: Declare the functions before main... The computer doesn't know these f... (by timprograms)
stacks and how to check if they are equal
 
I want to check if a stack is equal using stack.top etc to run down two stacks in a while loop anyone have a good example . I was thinking like this. te...
[2 replies] Last: Yes kevin is right. I would imagine this will be implemented in terms ... (by Smac89)
August 2013 Pages: 1... 1617181920... 51
  Archived months: [jul2013] [sep2013]

This is an archived page. To post a new message, go to the current page.