Beginners - January 2011 (Page 2)

Can Someone Clarify Private for Me?
 
The C++ intro book I've been reading isn't very clear on exactly how private works, so I can see two possible interpretations. Either only an object can access ...
[2 replies] Last: As long as line 9 is buddy.bar2(); . (by moorecm)
functions interfering with program inputs
 
Can someone please tell me why this program is not working as it should and why it does not let me type in any inputs after service level. #include <iostream...
[3 replies] Last: Note that service_level is an int . How many chars are in the word... (by Moschops)
Is boost support Rvalue?
 
gcc 4.5 has std::move and the containers of the stl of gcc 4.5 have been added move assignment and move constructor My problem is, the compiler I am using d...
[6 replies] Last: The specification has to go a year without any major edits before it c... (by jsmith)
getline reads one line too much
 
Hi, so I want to read a text file line by line, so that each row should be stored in a string. The text file looks like this: name1;phone_number1;address1 ...
[2 replies] Last: Wow that's worked! Thank you very much. (by xyz7000)
Binary problem
 
Hello i am a new c++ user and i got a little problem using the binary write. I m trying to transform a string into a binary but first of all the string stay a ...
[8 replies] Last: Alright i had one compression system but wasnt able to use it. Thx fo... (by firestat)
Polynomials, classes and member functions
 
Hello I'm currently in the process of implementing a Polynomial ADT - we have a class declaration file, and from that I need to perform an implementation tha...
[2 replies] Last: 2x^2+3b-1? Isn't that 'b' suppose to be a 'x'? If you only have to ... (by wolfgang)
by jaeya
Error while overloading operators
 
Hi, I'm programming a class for manipulating real matrices. I'm having some problems when doing a sentence like "c = a+b". The code is: class Matrix { publ...
[5 replies] Last: Found this web page helpful: http://www.cs.caltech.edu/courses/cs11... (by sadavied)
logic error i believe
 
My task is to write a simple program that takes in an unknown amount of numbers until the sentinel value is given then proceed to give out the average. The code...
[1 reply] : that's because it considers 9999 a valid number. if you'd only enter ... (by hamsterman)
by GulHK
malloc(): memory corruption error
 
Hi all Could anyone please tell me why do I get this error when I try to add another simple string type variable to the struct? *** glibc detected *** ./...
[4 replies] Last: Thank you once again Moschops :) (by GulHK)
by GulHK
finding 2 elements in one vector iteration
 
Hello All is there anyway I can find two elements in a vector in one iteration? e-g if(find(this) AND find(this)) { // then do this } Than...
[1 reply] : http://www.cplusplus.com/reference/algorithm/find/ substitude the alg... (by stereoMatching)
Recommend a good reference book.
 
Hi I'm pretty new to C++ and programming in general and i was wondering if anyone could recommend a good reference book for the language. Not a tutorial book i ...
[3 replies] Last: C++ In a Nutshell: A Desktop Quick Reference Ray Lischner http://w... (by closed account z05DSL3A)
read message from a file
 
Hi,I'm new to c++ & programming here,I have some questions about reading file source code: #include <fstream> #include <iostream> #include <strin...
[5 replies] Last: while( infile.get(letter) ) std::cout << letter; It's prettier.... (by ne555)
Other programming languages? (1,2)
 
Dear Guys, I'm thinking about to learn another programming language which will be useful (this is very important), not just to spend the time with somethin...
[23 replies] Last: Aww you think I had a future ! Thanks! *grin* Haha it looks promis... (by ultifinitus)
Arrays of classes issue
 
Here's the situation: I am creating a simple Civilization5 simulator (don't ask). I have a class called Tile which contains three ints food, hammer, and gold. T...
[2 replies] Last: The index of an array goes from 0 to n-1. (by ne555)
concatenate numbers with multiple periods
 
I'm trying to generate a few random ip addresses to put into an array but I can't remember how to concatenate multiple numbers with multiple periods. eg: 1...
[19 replies] Last: Thanks (by Johnnyboy)
hour:min format
 
hey guys, im working with c++ primer 5th edition, and one of the exercises it gives is to write a program to take 2 inputs from the user(hours and minuets) and ...
[7 replies] Last: just realized how retarded i was, i was using hour and min as outputs,... (by rjd82AA)
Doubles
 
Is there any way to prevent doubles from rounding? I'm preforming operations like multiplying and dividing but it rounds the double. Is there a way to prevent t...
[6 replies] Last: Alright thanks! (by tehrealbinglebob)
Time And CPU
 
I read about the clock( ) function not long ago. I wrote the application out as in the example and it compiled with no errors or warnings. When it had compile...
[4 replies] Last: Thanks Albatross. (by closed account zb0S216C)
Constructor and Destructor
 
Hey guys can any one tell what's happening in this code : class student { public : int static s ; student( ){cout<<++s ;} ~student( ){cout<<--s ;} }; int...
[3 replies] Last: [quote=billy29]it's a default one built in Bingo. http://www.c... (by Moschops)
Conversion of units?
 
Hi everyone, we are supposed to be making a program on Metabolic Equivalents. where i input the activity, weight and pounds and the program outputs the calori...
[5 replies] Last: Your welcome for the help. You forgot to include the value of calori... (by closed account D80DSL3A)
January 2011 Pages: 1234... 42
  Archived months: [dec2010] [feb2011]

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