Beginners - July 2011 (Page 37)

About Pointers
 
My teacher in school told me that we shouldn't use pointers since they make the program platform dependent. Since I haven't heard about this anywhere else. So,...
[7 replies] Last: Pointers are variables which store a memory address. Are all pointer... (by closed account z05DSL3A)
writing into array
 
i think i wen bit over my head with this. i want to write first 70 fibonacci numbers into array and then to print it out. but i dunno if i got it right. #incl...
[5 replies] Last: i made sme changes to my code, its still incomplete, and nees some cha... (by vastrolorde)
Solving for x
 
I am trying to write a program that solves a polynomial equation. When trying to solve for x, do I still need to initialize it? It seems like a stupid questions...
[1 reply] : It's good practice to initialize all your variables, even ones that ar... (by shacktar)
by tonnot
How are allocated objects inside a struct dynamically created ?
 
If I have : struct my_struc { vector<float> my_vector_of_floats; }; and I create an instance : my_struc a_instance_of_mystruct = new my_struc; ...
[2 replies] Last: A vector itself has pointers to a bunch of memory, the vector itself d... (by LB)
Need Small Help writing file
 
Hi guys, please overview my code below. I need help by creating the output of this code to a txt file.. or may be excel(if possible) .. ********************...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files/ add fstream fout("tes... (by hamsterman)
by tonnot
A map[a,b,c] how to use ?
 
I'd want to have a 3d map. map[int index, string key, string info_value] I know that 0 = "key1" , 1 = "key2" etc . But, How can I access to the 'info_value...
[8 replies] Last: Thanks Galik. This is what I said at the beginning, I need two maps. ... (by tonnot)
Reading from text file and finding three highest numbers from test scores
 
I need help for this assignment: Write a program that reads test scores (four scores for each student) from a file. The program should use value-returning fu...
[2 replies] Last: To get the three highest scores, you have to change the FindAverage fu... (by Kbfan)
by Rox
Templates and undefined reference to
 
I am reading about templates. I have created a list.h file containing this code: // list.h template <class T> class List { public: List(){} ...
[7 replies] Last: template <class T> class List { public: List(); virtual ~Lis... (by firedraco)
Char book exercise, getting weird error?
 
I am running into a strange error with the follow c++ exercise: Write a program that asks the user to enter his or her first name and then last name, and t...
[2 replies] Last: Thanks for the reply, I am going to bookmark that website for future e... (by georgewashere)
function will not return bool variable as true (1,2)
 
So i have a program that has a if statement - below-. if (questionint == true) { string q2 = "\nHave you eaten watermelon recently? "; askqu...
[31 replies] Last: Yes, that's right. Though like a previous poster mentioned, 'lines' is... (by Zhuge)
Problem with Absolute Value Comparison
 
I'm having trouble with the abs function. I have two variables - my_abs_minimum and r, both are type double. I need to compare my_abs_minimum to the absolute ...
[6 replies] Last: Not really feasible. This is part of a fairly long class implementati... (by joatmon)
by eidge
Function Overloading picking wrong type
 
I have two classes: Fraction and UnitsFraction : Fraction. UnitsFraction only has a string units; member more than fraction. The problem is the following: ...
[9 replies] Last: Thank's I'd never get that by myself. It actually scares me that you g... (by eidge)
Polynomial equation solver
 
I need to produce a program that solves either(yet both) a quadratic equation and a polynomial equation. I have the quadratic equation but I am totally lost on ...
[1 reply] : Here: http://www.cplusplus.com/forum/general/17664/ I believe it's t... (by eidge)
by acorn
assignment operator and self assignment
 
I was reading a article the other day and they were really adamant about checking for self assignment in the assignment operator. Then I read this really great ...
[2 replies] Last: haha ok (by acorn)
Implementation File Error: C2011
 
I've been looking of solutions but apparently this error isn't quite narrow enough, The exact error is 1>c:\users\bombshell\documents\visual studio 2010\proj...
[3 replies] Last: Just so you know, the class defined in the header file can contain ful... (by Catfish)
My variable will not cout
 
I am trying to get line 84 to print to screen. #include <iostream> using namespace std; #include <string> class DayOfTheWeek { public: void setD...
[2 replies] Last: Also, you could move your cout << idx << endl; above the switch() .... (by Catfish)
by swp
error help plz
 
getting this error on the lines of the 2 equations, not sure why..? error C2064: term does not evaluate to a function taking 1 arguments float quad(istrea...
[7 replies] Last: You misplaced a bracket by the way, it should be this: qans2 = (-b... (by shacktar)
by ilnara
dynamic string sscanf reading problem
 
ook people; newly hatched nube joins the action :) here's my problem: string ras = "straus"; int i; i=ras.length(); WORKS ...
[3 replies] Last: No worries I've been (am) there. I liked "C++ without fear" the non O... (by eidge)
by chulio
problem with library limits
 
Hello, i have this code: #include <iostream> #include <limits> #include <stdio.h> #define INF numeric_limits<int>::max(); using namespace std; int main(vo...
[6 replies] Last: #include <iostream> #include <limits> #include <stdio.h> using name... (by Moschops)
A Few Beginner Questions
 
I have a few questions, that google and my current book just can't seem to answer, so I was hoping maybe someone could. :) When using the #define macro, can ...
[5 replies] Last: I found that msdn article helpful to me to thanks. i didnt know that t... (by acorn)
July 2011 Pages: 1... 3536373839... 54
  Archived months: [jun2011] [aug2011]

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