Beginners - April 2013 (Page 20)

How to get object name from within class methods
 
I'm working on a project in my programming class that you're supposed to make a .h and .cpp file that you can set values of an array, get values of an array, pr...
[4 replies] Last: Okay, that's kind of what I thought. Thank you! (by zmarchbank)
ofstream saving extra lines
 
I have been writing a flash card program and have just got to saving and loading data. The program currently takes data from a file a puts it into the program b...
[2 replies] Last: Thanks a lot man! After I changed that I realized I had a double "<< e... (by Aquacold)
Question about C strings
 
What exactly does this line mean when we use it with c strings? stream.getline(variable, max_size);
[3 replies] Last: thanks (by closed account LN3RX9L8)
C++ problem. Converting integer into a String based on digits
 
This problem is really simple. I want to convert the integer into a string. int x = 693; char chararr ; in my homework, x is unknown. but dont wo...
[6 replies] Last: Ok. So you can do exactly what you want with this code: #include <io... (by Zaita)
Passing an Array of Structs to a Function
 
Can someone point me in the right direction? I'm a beginner but i'll try to explain this the as best as I can. How can I edit specific fields from my struct in ...
[1 reply] : Arrays are by default passed through as a reference instead of a copy.... (by Zaita)
Using loops
 
A section in my code needs to ask if you want to add, subtract, or exit. I cant get it to keep looping as long as you don't want to exit. What is wrong with thi...
[2 replies] Last: Also, your if statements never break, so it will never actually exit o... (by Ispil)
Exception Handling
 
My code seems to work fine for the maximum size, which is 39, but not for the minimum. Problematic function: void Diamond::SetSize(const int diamondSize)...
[2 replies] Last: Well, for one, you're trying to manipulate the value of size- which is... (by Ispil)
Problem with class.
 
I have this code where I need to add the inches and feet together to 1 number. I have to use int CDistance::add(const CDistance&) const to do it though. But whe...
[5 replies] Last: http://www.cplusplus.com/doc/tutorial/functions/ http://www.cplusplus.... (by Zaita)
Deleting a class stored in a vector
 
I have class called Entity that I have to dynamically create, so I store it in a vector called EntityList. I am trying to make it so that when I get a certain i...
[2 replies] Last: You cannot use delete this; because this will cause undefined behavi... (by Zaita)
Problem with inialization: for Class
 
How do i initalize output1 and output2? #include <iostream> using namespace std; //Conversion from feet to meters; conversion1 = 0.3048; //Conversion f...
[1 reply] : You have more problems that just this. You're not passing the values a... (by Zaita)
convert 4 letter words to love
 
okay so im writing this program that is suppose to convert any 4 letter word in an input to love, Love if its the first letter of the sentence. For example if i...
[6 replies] Last: I'm sure there is a much easier way to do this...but this seems to wor... (by giblit)
|38| error: invalid use of template-name 'tnode' without an argument list|
 
Why can't I create a new tnode in the bstree (Binary Search Tree) class? TNode.h------------------------------ #include <iostream> #include <cstddef> #inclu...
[10 replies] Last: I still can't figure it out. (by Jaskiratpal Singh)
by Ludidi
list positive numbers
 
i stuck on b n c A list of positive numbers is read into an array from the keyboard. The list finishes when a number 0 is typed from the keyboard. a. Find ...
[2 replies] Last: You obviously can spot the above and below values and you do know each... (by keskiverto)
by Daleth
Pros and Cons of a range-based for loop.
 
So far, the only pro I read about range-based for loops is its legibility, which I find questionable, because, to me, the syntax looks more vague than helpful. ...
[6 replies] Last: Thanks everyone for sharing your thoughts. I'm starting to understand ... (by Daleth)
Trouble using the getline function in do/while loops
 
I'm creating a program that allows you to enter up to 100 books and the books information such as Title, Author(s), Publisher, ISBN, Cost. I'm using the getlin...
[3 replies] Last: For that question, on searching the array, I think you will need to po... (by Chervil)
Printing data from a file
 
Hello! I copied data from a structure into a file, but I am having trouble figuring out how to print the date from a file, since I can't just create a for loop ...
[no replies]
by Devra
It shuts down!
 
Hi everybody. I need help with this program. It shuts down, i'm using Microsoft VS. It's C++, isn't it? I think yes. #include <iostream> #include <cmath> #i...
[1 reply] : Look at: http://www.cplusplus.com/articles/iw6AC542/ (by firedraco)
Problem with Custom Exception
 
All, I need to create a custom exception called "IllegalSubscriptException" for a function called Rational that should let the function operator throw this ...
[3 replies] Last: does not work is not an error message (by ne555)
by jnf102
error
 
what did i do wrong #include <iostream> #include "conio.h" #include <string> using namespace std; int Addition(int x, int y); int Subtraction(int...
[3 replies] Last: Line 15 the t in mathtype should be uppercase. Line 22 the t in mathty... (by Yanson)
by tony47
cannot find ISDL-ttf
 
Hi everyone, I'm learning about lazyfoo's tutorial,here's my small problem. I'm using dev c++, I downloaded the ttf file and set as below: tools-> directo...
[no replies]
April 2013 Pages: 1... 1819202122... 83
  Archived months: [mar2013] [may2013]

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