Beginners - November 2010 (Page 22)

testing resistor classes.
 
Hi everyone. I have to do something whereI create a class that models a resistor and then create a main function where it will call on three different resist...
[2 replies] Last: ok this is what I have and I need to get output to show values on thre... (by shankman2k9)
Divide by zero prevention squad
 
Hi, I am making a program to do some simple math. everything works fine, Addition, Subtraction, Multiplication, and (kinda) Division. My problem is: ...
[6 replies] Last: Thanks!!!! (by smd75jr)
undeclared identifier
 
Can somebody please explain to me what I need to do to fix this problem? Time::Time() //default constructor sets the hour and minute { hour = 0; minute =...
[7 replies] Last: You have "hr" and "min" in your class. You also have two parameters ... (by Zhuge)
by SeBeQ
Struct in hpp error
 
Hi I use C::B (Code::Blocks) with MinGW when I put struct in HPP file I have error: ||can't open file `LVGROUP': No such file or directory| ||=== Build f...
[6 replies] Last: Code::Blocks 10.05 with GNU Compiller 32 bit -= MinGW libraries (by SeBeQ)
fstream doesn't work inside header file
 
it works when called from the main() function but it doesn't work when its called from the class inside the header file its saying that fstream functions can...
[3 replies] Last: If this is your entire header file then you are missing stuff. #... (by Duthomhas)
by Rave
Classes: Accessor functions and link list
 
Hello, i have a small problem. i have to classes and one acts like the head node, while other acts as the list, consists of some data and another pointer to the...
[12 replies] Last: mostly, i just make headers and cpp files and put them into a single f... (by Rave)
by arty
Problem in "if" function
 
Another stupid newby question :( I wrote this programm, and the "if (check==height)" in the "while" sequence doesn't work (it's never true). The problem migh...
[2 replies] Last: I was required to use floats and didn't know that I can't compare them... (by arty)
strings don't work in header files
 
is this normal? my program won't recognise strings in header files class CGame {//this class is responsible for running the game public: CFileStorage ...
[8 replies] Last: You can't call ifstream, it's a class, not a function. Can you be m... (by Disch)
by fafner
fgets problem
 
This is strictly C, and not c++, but I hope I wont get a raging mob after me for it:p Im trying to read a file line by line using fgets. The file im trying t...
[2 replies] Last: Awesome, increasing the array worked perfectly! Thanks;) (by fafner)
complier errors?
 
#include <iostream> #include <string> #include <fstream> using namespace std; 21int main() 22 { 23 24 double x1,x2,x3,x4,y1,y2,y3,y4; 25 ifstrea...
[2 replies] Last: Thank you sooo much! (by monkeyhobo)
Constructive criticisms on working code
 
Hello, my program works fine, but I would like to know how I could improve it. Tips on organization would also be welcome. Thanks! #include <iostream> #inc...
[3 replies] Last: Hey, I'm trying to cut it down. The distancemeters and distancemiles ... (by Spiffy P Mcgee)
call to a member function
 
what am i doing wrong here. i cannot get my program to call a member function. if (choice == 2) { editMenu(); cin >> choice; cin.ignore()...
[1 reply] : You have to create an object : menu my_menu; // ... my_menu.addW... (by Null)
by arty
Problem with input/output with files
 
I'm really a beginner in C++, so my questions might seem dumb, but still... I have to write a programm that finds a minimum number in an input file, and cou...
[2 replies] Last: Thanks, I'v been trying to find it out in books for like 2 days, and i... (by arty)
Where to start learning C++
 
So I was wondering if anyone could suggest to me a book that would teach me C++, I had looked at some books on C++ initialy, then I realized that I had no clue ...
[5 replies] Last: you can read a good book.Let you tell Stanley Lippman C++ Primer ... (by firix)
Variables
 
How come I can change the integer given to the specific variable, the given integer is not permenant for one variable? For example: int x; x = 0; cout << ...
[5 replies] Last: The easiest way would be to use a do-while loop. You will need somethi... (by Tabian)
Lost the will to live!
 
Hi all, Thanks so far for all your help you have given me. My latest problem so far I can't seem to get my head around. Basically I am making a program ca...
[8 replies] Last: I have figured it out. I was putting user::setage (int); ... (by loosebruce)
Converting decimal to binary, octal and hexadecimal
 
I'm working on a program to convert decimal to binary, octal and hexadecimal. I can get the code correct to convert decimal to binary and octal, but in reverse....
[4 replies] Last: Still working here folks! Anyone with input Please respond! I got th... (by anthonys1mom)
access static private members of a class
 
So I have a class : ///header class C { private: static int i; public: void set_i(int j); }; ///cpp int C::i=0; void C::set_i(int j){i=j;} //...
[4 replies] Last: Thanks :) (by Mr and Mrs D)
by Frzn
Morse to text
 
I have a problem with translating morse to text, and I have no clue how to overcome this obstacle. Here is my current code: #include <iostream> #include <s...
[8 replies] Last: I:\morse\morse.cpp|45|error: ISO C++ forbids comparison between point... (by hamsterman)
by Rave
Link list nodes, inserting a node.
 
hello, i am trying to insert a node at the end of the list. #include <iostream> using namespace std; class node { private: int key; ...
[1 reply] : You can't assign to a value returner by a function. Function just crea... (by hamsterman)
November 2010 Pages: 1... 2021222324... 42
  Archived months: [oct2010] [dec2010]

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