Beginners - April 2015 (Page 10)

function print 0 all the time?
 
I am trying write a simple function that outputs the standard deviation of a cloud of points, but for some dumb reason it keeps outputting, 0.. Why? Here i...
[1 reply] : > Std_dev = Std_dev*(1/points.size()); integer division returns an i... (by ne555)
g++.exe stopped working
 
Hi, when I was trying to compile my program on C++, the window respond that a problem has caused the program to stop working but I did not know the problem. Ple...
[6 replies] Last: Hello world (by Adesola1093)
private object initialization in another class
 
Why is o/p of this code not calling assignment operator? In class B, A a; should call A::A() and then in initializer list at : B(A &a):a(a) , it should c...
[5 replies] Last: @keskiverto thanks for clearing the concept (by aseemgoyal)
String with a space using structers
 
i want to make the user to type a string with a space. my programm works but without a struct so what and where is my fault ? #include <iostream> #i...
[4 replies] Last: @malmsteen Add cin.ignore(10, '\n'); after the cin >> n input to ... (by whitenite1)
by enemy
a.side ??? Is a an object???
 
Hello! Please, can someone make me clear the construction a.side in next example? Does a not look like an object? But it is NOT an object, it is just an argume...
[5 replies] Last: Hello! Many thanks, think I got it! But still obvviouly not completel... (by enemy)
problme if i change constate with a variable !!
 
Write your question here. new i have another question if i change number 3 [ for(int x=0; x< 3); x++) ] with a variable , the programe won't work. #i...
[5 replies] Last: No prob bob (by closed account 2LzbRXSz)
constant objects
 
Hello everybody #include<iostream> using namespace std; class ColourLight { private: int val; int checkValue(int c) const { swit...
[no replies]
by JFe95
c++ practice turned to frustration
 
I offered to make my girlfriend a grade calculator for some c++ practice. I've got this far to find out that it outputs all my module scores as 0 and the over...
[4 replies] Last: Oh wait, Line 26, I see now... (by JFe95)
need help on string objects homework
 
Line 42: it says "no matching function call to std::basic ifstream char..." and then in the next line it says "note: candidate is:. it works fine if I hardcode ...
[1 reply] : > then in the next line it says "note: candidate is:. keep reading (by ne555)
by new1
how to clear the nested maps
 
i want to know how to clear the contents in map and list which are in nested like as below can anyone help me in this. list<string>my_list; map<string,my_...
[2 replies] Last: thanks for reply, If i use the above , it will only for map2 i.e of ou... (by new1)
C++ Programs
 
Some programs for creating .exe c++ files and edit?
[2 replies] Last: Some programs for creating .exe c++ files and edit? it is called c... (by xenovia12)
member variables vs member functions
 
I seriously do not know what the difference is, could anybody please provide a sample as to what a member variable is and what a member function is? Thank y...
[4 replies] Last: Thank you very much for the help, you cleared up my confusion over thi... (by NookLines)
Finding highest/lowest number from an input file
 
Hello all, I have an assignment that I am needing some guidance on. I need to find the highest/lowest value from an input file (along with the average, sum, ...
[2 replies] Last: It would be easier to make two separate functions for max and min, and... (by Arslan7041)
Printing Message log for Flight transaction
 
I have an assignment involving parallel arrays in which I have to update data of flight transactions. Im almost done with it, except the message log is not prin...
[1 reply] : Anyone? (by Arslan7041)
error with printing out stars?
 
the error is in main where i call PrintChar. it says 'h' is undefined but i thought i defined it with getters and setters. can you tell me where i went wrong? a...
[1 reply] : The 'h' and 'w' names are only defined inside the functions 'setHeight... (by ShiroAisu)
by Thecal
Output from array is incorrect. Help please
 
Thanks for taking the time to read my post. I am writing a program where I read in data from a file into an array and a 2D array. However, when I cout that data...
[7 replies] Last: Ah, I thought it meant that my braces didnt pair up correctly with ea... (by fg109)
by Bocian
Need help writing class to binary file.
 
Hello, im trying to write a class into a binary file, although i am getting some errors when i try putting in information. I have 3 files, a driver, header , a...
[3 replies] Last: I was wrong about what problem I thought you would have in using strin... (by fg109)
Trouble initializing vectors in classes
 
Hello all. This is my first time posting, so please let me know if I do something to offend/frustrate you (I know how us new guys can be). Anyways, I'm fairly n...
[1 reply] : You cannot assign values to your class member variables unless they ar... (by fg109)
by as4mvp
PLEASE NEED HELP: Sorting Dynamic Array while reading file
 
I have an assignment in which I have to read from a file called ("random.txt") output the total and copy the file into an array dynamically. Then sort the value...
[2 replies] Last: The while loop inside my for loop was an attempt to read the values. I... (by as4mvp)
Linking Errors: 1120 and 2019
 
Hi all, I am trying to make a mathematics program for my own personal use and have searched the internet with no definitive answer to the common LNK2019 and ...
[1 reply] : Templates have to be entirely visible. You cannot hide the template i... (by keskiverto)
April 2015 Pages: 1... 89101112... 52
  Archived months: [mar2015] [may2015]

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