Beginners - February 2013 (Page 51)

by Bien30
Classes and passing values into them
 
Hi I'm trying to practice making a class in separate files. Eg. main(), Temperature.h, Temperature.cpp I'm trying to pass a user input value say 10 degrees ...
[1 reply] : Just proceed as if you defined the class inside this file. (by maeriden)
by Z feng
error C2143: syntax error : missing ';' before '->'
 
code deleted
[14 replies] Last: WOOOOOO, Great! It's working!! Ya, You create an uninitialized point... (by Z feng)
by rcast
Problem with class...
 
I'm trying to create my first class but I keep getting an error at compile for each of the 4 shapes in the class member, shape. Error documents\visual s...
[2 replies] Last: Bollocks! ok, Thanks! (by rcast)
I need some help with uninitialized local variables
 
I'm working on a homework assignment for my college c++ class. I'm new to c++ and have only been programming in java in my first semester of college with no pri...
[2 replies] Last: That fixed it. Thanks a lot! (by pdaniels0013)
Using assert after allocating dynamic memory
 
When allocating dynamic memory I have learned that it is important to delete the memory allocation before the program ends. What happens to dynamic allocated me...
[4 replies] Last: Thanks! (by northmoose)
If/Else loop input validation
 
Hello all: I'm trying to figure out input validation. The users options are either A,C,He,or H. If they cin a valid input, then I proceed with the switch tha...
[4 replies] Last: this is incredibly helpful thank you kindly (by theCoach)
Help with if/else homework
 
The problem is: The state government has decided to give a 4% raise and $500 one-time bonus to non-teacher state employees. Teachers will get a 7% raise and $...
[2 replies] Last: Thanks. (by audstep)
by souper
Help with fork command
 
Hey all, Having trouble compiling c++ written code due to a fork() command issue. I am working in Code::Blocks with the GNU GCC Compiler. Here is my code:...
[1 reply] : That error is not a compile time error, but rather a linker error. Th... (by AbstractionAnon)
BMI Calculator Project (weight formulas)
 
Wasnt sure if this should go in the beginners section or not, but here is my issue. I have to program a BMI calculator that calculates the users BMI and tells ...
[3 replies] Last: No problem. It looked like the equations were functioning properly fr... (by aperio)
by s1l3nt
Creating a file from console
 
So, I have question. I already know how to open a txt file so you can write data to it and close it but lets say I wanted to have a console application that pro...
[3 replies] Last: To create the file: http://www.cplusplus.com/reference/fstream/ofstrea... (by MrHutch)
Need help with code
 
Hello i am trying to write a programm for my college c++ class. This class is the second level and i took the first level two years ago due to just transferrin...
[6 replies] Last: it worked lol. i realize now why it wouldn;t work with have the endl ... (by stc5097)
Trying to get the correct output!!!!
 
#include <iostream> #include <cmath> using std::cin; using std::cout; using std::endl; double func_1(double); double func_2(double); double func_3(d...
[1 reply] : And here is some more information: n = number of rectangles and/or tr... (by bruntmjust)
Repeating character in c++?
 
I'm writing a code which tells the user how many times a word they input can be written as. I know that the general "equation" one could call it is: Let's say ...
[1 reply] : #include <iostream> #include <cstring> #include <string> unsigned re... (by cire)
by odai
what is the wrong in this code !
 
the compiler does not enter into inter for !! who can tell me why ? #include<iostream> #include<cstdlib> #include<ctime> using namespace...
[13 replies] Last: #include<iostream> #include<cstdlib> #include<ctime> using namespace... (by eraggo)
Issues with Input Validation
 
Hey guys. I'm having some trouble with input validation for one of my assignments in my Advanced C++ class. I'm using g++ on my linux box. Weird thing is, when ...
[5 replies] Last: Fixed it. My cin,ignore statement for both snippets is now as follows:... (by sirjames2004)
by krutuk
Please, help me with this mistake. I'm totaly confused
 
Program is compiling well. But after execution the result is: Average math: 3.67 Average phis: 4.33 Average inf: 4.33 Result: 4.67 Segmentation fault The result...
[4 replies] Last: As I understood you, this program is bad at it purpose. Thanks, I will... (by krutuk)
by vrakas
Comparison of double,long double and floats
 
hello. i want to compare the equallity of two doubles a nd b. A friend told me i should not test if(a==b) but if(a-b<1e-9) i.e. a-b<10^-9 Is this the...
[3 replies] Last: @JLBorges Thanks a lot! I needed to read an article! @MiiNiPaa i dont... (by vrakas)
by kwnan
read and write to a file
 
I would like to wrte a content of two varible to a file to be read in void handleRequest(char *request, int request_len) { Writ_to_file(request, req...
[3 replies] Last: That is unfortunate, indeed. Why don't you give it another go and come... (by MrHutch)
Problem making simple loop
 
Hello I'm completely new to C++ and only use it through R. Anyway I'm trying to make a loop - since looping in R is rather inefficient: cppFunction(' Nu...
[no replies]
invalid-iterator-argument.
 
Hi, I am trying to create a program that will take 10 numbers and then print the sum of the all two adjacent numbers and then sum of 1st and last,2nd and 2nd la...
[2 replies] Last: Thanks, now I have re wriitten the code and it works fine. its a bit l... (by tamimaddari)
February 2013 Pages: 1... 4950515253... 67
  Archived months: [jan2013] [mar2013]

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