Beginners - May 2012 (Page 47)

help a newbie out =)
 
I know I am been asking this question. But I am so close and I don't understand what to do. I can get everything to work just fine but one thing. It prints out ...
[4 replies] Last: I think whatever method you use to sort it wont keep track of the righ... (by Damadger)
by srk24
Advantages of Constructor over Assignment operator
 
Can any one let me know on what is the advantage of default constructor over assingment operator. take an example. class A { int a,b; a=0; b=0; }; ...
[4 replies] Last: You simply can't make an in-class definition this will not obey the c+... (by Damadger)
string.find() issue
 
Hello I'm having an issue with the string.find() string::npos function. Here is my code... This is my custom function for searching strings... string srchSTRb...
[no replies]
Weird Problem In Loop
 
I finally succeeded in getting my Simon Says program up and running. It works fine up until I go to receive the third color. When I enter a key to receive color...
[4 replies] Last: ^ That was your original code, but easier to read. Sorry I don't know ... (by Gregory Sakas)
Problem with overloading operators.
 
Let me start this by saying that I don't really understand the concept of overloading operators. I was out sick that day (figures, the one day I miss it's somet...
[4 replies] Last: I looked through rational.h and didn't see anything that was like that... (by projectfilly)
string vector declaration
 
Hi, I'm trying to declare a vector of strings but it doesn't seem to be working. vector<string> colourMenu ("Red", "Orange", "Yellow", "Green", "Blue", "...
[2 replies] Last: If you are using Code::Blocks, go to Settings-->Compiler and debugger... (by rainshark)
Dungeon Crawl output different w/ debugger vs build&run
 
I'm trying to make a basic grid based dungeon crawler from the beginner exercises page. When I build&run and the program prints out the board char array only ...
[no replies]
Structure of Vectors
 
Ok so I'm having a bit of a problem with reading data in from a file into a vector of type struct. For some reason when I try to read data in from my file hand...
[3 replies] Last: Well while(!fin.eof()) does work. As you read in data from the file, ... (by Cubbi)
erase method for a custom vector
 
I was wondering what could be the best way to create a erase methods to a custom created vector class that depends on allocate to deal with memory. The class ha...
[1 reply] : Well as nobody have offered help yet i wonder if the code below is a g... (by Damadger)
Need help with Decimals!!
 
Sorry to bother everyone but, I've only been at C++ since Wednesday. I need to know how to multiply decimals. Been looking for a FAQ or something but maybe I di...
[8 replies] Last: You should set precision before you calculate the answer. (by paulthepenguin)
Best way to define physical contants?
 
Hi there, I often find that I need to define a bunch of physical constants that must be shared by many classes. I have done a little research and I have foun...
[1 reply] : I only program occasionally in C++, so probably my first choice would ... (by webJose)
by tmdm7
Assigning an object address to another class
 
Hello, I'm having trouble understanding why this isn't working. As an example: class house { private: Person one; Person two;...
[3 replies] Last: Thanks for the quick response guys. I understand what you are saying.... (by tmdm7)
by atjm88
::?
 
Low::Mig(string J, bool K, float thr) { } void Low::Cis(string J) { } Hi, can I know any different between 2 code above? Why one have void , another on...
[1 reply] : You can probably find your answers if you study a basic C++ tutorial. ... (by webJose)
Long long int not holding my value
 
So I need to store a large (trillion) number and am trying to use unsigned long long int. But when trying to store it, it says that "error: integer constant ...
[10 replies] Last: It does but only with an extra underscore. (by rozick1)
memory mangement
 
Hi everyone I just wanted to know how a programmer can manage memory blocks or how memory management can be done in C & C++
[1 reply] : When you need some memory, ask for it with new or malloc. You get back... (by Moschops)
New to c++ while loop functions
 
I'm to write a program using function to ask the user to enter their grade in a class, then determine the GPA. All the while keeping track of the number of peop...
[3 replies] Last: Here is your code formatted: char getValidGrade() { char grade; in... (by Lowest0ne)
root with pow() not working
 
I'm trying to evaluate the root of a integer with pow() but it always return me '1' int a = 0, b = 0; cin >> a >> b; cout << pow(a, 1/b) << endl; ...
[3 replies] Last: since I'm passing the result of the '1/b' The result of 1/b is an i... (by Moschops)
by Zemorg
Substring Out Of Range? File Stream ()
 
Hey guys, i'm Working On A Project That Gets All Employees And Their Data From the User Then Saves Them in A Txt File ( Fstream ) Anyway, i figured out how t...
[4 replies] Last: Sorry if my questions are abit stupid but you could say i'm a beginner... (by Zemorg)
by bailey
Reading integers from a data file
 
Hi, I am inexperienced with c++ and as such am unsure how to do this, I was wondering if someone could give me some help. I have a data file with 2 columns of v...
[12 replies] Last: viliml is right remove the (double). Sorry I was wrong, it happends. F... (by uhraurhua)
by ccj443
Linker error: undefined reference to inData()
 
This is my first time posting here so if I do not do it correctly please let me know. We are doing a group project for our final assignment, and our group leade...
[1 reply] : This is some hideous code (don't take that the wrong way - all beginne... (by Moschops)
May 2012 Pages: 1... 4546474849... 59
  Archived months: [apr2012] [jun2012]

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