Beginners - May 2013 (Page 3)

IF/ELSE not working
 
Write your question here. I am new at C++ and having problems with this code, it always takes the first option on the IF even if I hardcode the option to a dif...
[5 replies] Last: For future reference, if you want 'not equal' use != (by BradleyHeat)
Majority number in a string problem
 
Hello guys, I'm trying to make a program where the user inputs a sequence of numbers I.E 1 0 0 3 4 0 6 0 0 (numbers separated by spaces) and the program has to ...
[6 replies] Last: Oh, okay. Fair. Hadn't thought of that. But now I feel like I should h... (by Thumper)
Where are my "getchar()" commands throwing me off?
 
If the user is to press 'q' or 'Q' then enter to quit, rather than exiting at the first push of enter, the program makes thee user presses enter two more times ...
[no replies]
Need help!
 
I'm doing this project for class and it requires that the variable never hits 1. The variable also either goes up by 1, or down by 1 every time you do something...
[9 replies] Last: int theVariable = 0; char c; do { std::cout << "Variable is equa... (by vlad from moscow)
Help with c++, saving to txt and etc
 
Hi, I'm quite new to c++, but I am trying to test myself by creating a kind of virtual journal, and I have 2 problems. So the problem I am having is I can get ...
[3 replies] Last: How about running through these? http://www.cplusplus.com/articles/N6v... (by Zhuge)
SPLAY TREE SPLIT OPERATION
 
can anyone tell me how to split a splayTree without any change in old splayTree???
[1 reply] : Uhh... save a copy? I don't understand what you mean by "to split" a ... (by Catfish4)
Updating a data array using pointers
 
How can I do for change the value of cars using pointers? I tried the code below, but I cant use pointers with arrays... Thanks #include<iostream> #include...
[6 replies] Last: int * i = new int ; int * j = new int ; //You would need to give the... (by AlitCandle)
Binary to Decimal Converter
 
Having read the preliminary stuff, I understand that you guys do not provide help with homework problems. However, I am not paying money to an institution; I'm...
[9 replies] Last: As for ignoring white spaces, the book (chapter 4) actually says the ... (by Chervil)
Accelerated C++ - Outdated?
 
Hello, all! I just recently finished my first year of University. So far, I have spent one semester learning C++ and one semester learning Java... Problem is...
[5 replies] Last: Accelerated C++ is not an outdated book. Like others have written - i... (by closed account ypfz3TCk)
C++ problems
 
I have a problem, When i run my Program, it tells me to input a name which is what is't meant to do, but when it says are you sure it's (name), it only shows th...
[5 replies] Last: he will have an issue if he types in a first and last name so: getlin... (by gobiking)
by yeki
calling a code
 
Hi all I have a code that produces two vector called x and y, I want to use these vectors in another code, How can I do that? maybe this question is absurd,...
[4 replies] Last: Well, are these two vectors in their own classes as of right now, or e... (by Ispil)
Floating points number
 
what is the diffrences between regular float data double precision and long double precision and what is double precision
[1 reply] : float: 24 significant bits of mantissa, 8 bits exponent http://en.wiki... (by MiiNiPaa)
by Zoo
How to check if input is an operand?
 
I am trying to find a way to check if an input is an operand. Is it okay if I go: fstream file; file.open("sample.txt", ios::in); if (file==int) // no...
[5 replies] Last: Small comment, there are floating-point numbers such as 12.53 here. Ra... (by Chervil)
What is wrong with this code?
 
Hey guys, seeing as I've only been programming in C++ for a few weeks, I've looked around the forum and seen a brilliant thread with some beginner exercises. I'...
[3 replies] Last: Olysold and ar2007 - you guys are stars. Thank you very much! (by taurine14)
Template find()
 
Is there another way to increment the iterator while still keeping the const of beg? This works fine for vectors but I guess the compiler is freaking out when i...
[3 replies] Last: > the 3rd just flies over my head, gonna have to take a look at that c... (by JLBorges)
by Farsox
Baffled by lack of iterations
 
I would consider myself a beginner to C++. I took a couple of classes in high school that dealt with simple C++, but that was 12 years ago. I haven't really t...
[3 replies] Last: Nice! I should've remembered that. Thank you to both of you! (by Farsox)
HELP LOOP!!!
 
Write your question here. I have no idea how to get the subtotal with the loop. This is still not Finish btw Cashier 2.0 is a C++ program that displays on t...
[3 replies] Last: this works. lack of comments in the source code, but at least it studi... (by ar2007)
ERROR : invalid types ‘double[int]’ for array subscript
 
Receiving this error "invalid types ‘double ’ for array subscript" on this snippet of code on line 17 and 27: // Normalization for the p(H|I) do...
[6 replies] Last: right on, i thought i had changed that into an array earlier but i mu... (by dhilchie)
dynamic array
 
I have a quick question. I have a class in which i want to create an array, the size of which is only known at run time. Can i create this array in the class c...
[4 replies] Last: Cheers mate, (by Crakrjack)
Mystified by "error: expected unqualified-id before 'using'"?
 
So, I feel dumb for beating my head against a wall for half an hour on this, so I figured I'd share my ordeal with others to save them some time. I had a cla...
[1 reply] : You need semicolon after class definition. Also: do not use "using" in... (by MiiNiPaa)
May 2013 Pages: 12345... 66
  Archived months: [apr2013] [jun2013]

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