Beginners - October 2009 (Page 8)

how the member function can access private variable
 
Hi I have a strange question. consider the following example. I understand that private variable can be accessed only by private or public member functions. ...
[1 reply] : Private members can only be accessed by member functions of the same ... (by helios)
error C2061
 
: error C2061: syntax error : identifier 'density' I have done quite a bit of research about this error on the internet. It seems as if the common answer is ...
[4 replies] Last: Ha. Wow. Perfect answer. I completely missed that. I had been changing... (by Programmer Will)
trouble printing an array....
 
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an array and did soo, but can't print out. My result is zero. if an...
[4 replies] Last: Ok i see. I looked at the tutorial and it explained it to me better th... (by bwright)
by triz
Entering values for choices
 
I'm trying to write a program where it asks for which choice, A or B and after selecting the choice, allows the user to enter a value for that choice. I'm not e...
[1 reply] : Please use [co de][/co de] tags and format your code. I'm not rea... (by chrisname)
by sato
Learning technique
 
Hi I am learning c++ from the book. What would you recommend: to got through the book as fast as resaonably possibly and then go back and study examples in mor...
[7 replies] Last: Just because your teacher doesn't use it doesn't mean the book sucks. ... (by chrisname)
problem with project
 
Hi everyone. I am new here and here is what I have going on. I have been working on a project for my Beginners C++ class. I need to make my code to not accep...
[1 reply] : What you have posted above doesn't compile - there are some errors an... (by guestgulkan)
Function summing n integers
 
Having trouble writing a function "compute_sum" that will ask for n input and then sum the first n integers (If 5 is entered, 5+4+3+2+1). I assume the function ...
[4 replies] Last: Fair enough, I will spend some more time on it and figure out the rest... (by foncused)
Taylor Series Function
 
So I am working a a project for my intro C++ class, and I am having some trouble with a function for approximating exp(x) using a taylor series. The taylor seri...
[3 replies] Last: Thanks a lot!! It works. (by iowabball)
by Fsmv
Multi dimensional arrays
 
If I put in this code: #include <iostream> using namespace std; int place = {{0,1,2,3,4,5,6,7,8,9},{9,8,7,6,5,4,3,2,1,0}}; int i; int main(){ ...
[4 replies] Last: The problem isn't with the array definition, it is will your for loop... (by Fsmv)
by baross
Converting numbers to months -
 
The porgram works -just need the last function(month_convert_ to convert numbers to months -thanks. #include<iostream> #include<string> #include<iomanip...
[4 replies] Last: To Kempofighter: Thank you for posting the link and for calling my... (by baross)
Unit Transformer
 
Hello I found an exercice which seems important for me Write a program that can transform from centimeters to inches to foot as follows: At the beginning th...
[1 reply] : Don't use void main, use int main instead. You have some illegal st... (by firedraco)
If statements Exercices
 
Hello. I have an exam tomorrow in "if statement" it's just a small Quiz and the teacher will ask us some nice Questions. Please where can i find some Qu...
[2 replies] Last: I would just review information on control statements and operators. ... (by kempofighter)
Doubles are giving me problems
 
Ok so, first of all i made a double = 0.05, but when running the debugger it shows up as 0.04999. I know this has something to do with how doubles store but its...
[8 replies] Last: Ok problem solved just had to change the condition of the while loop s... (by Ima noob)
Libraries in C++
 
Hi all, I have two libraries. one is based targeted on linux platform and uses another library which is windows based by default. By following the instru...
[10 replies] Last: Hi Helios, Thanks for the help. Since, this thing didn't work I am ... (by abhipro)
How to calculate the prime factors of a number using a function?
 
Hello. I'm new to c++ and trying to get used to using declaring and using functions. For practise I'm trying to make a program to take an integer input from the...
[6 replies] Last: I would use a std::vector<> or std::deque<> instead of an array; they ... (by jsmith)
Calculating n! using vector
 
#include <cstdio> #include<iostream> #include <vector> using namespace std; int main() { //declaration int i,n,num,val,temp,j,l; vector< vec...
[2 replies] Last: Your problem is that you aren't managing the carry correctly, because ... (by jsmith)
by Bv202
Dynamic memory problem
 
Hey, At the beginning of my code, I have this line: Shape* gShape = 0; As this is dynamic memory, I delete it at the end: delete gShape; gShape = 0; ...
[6 replies] Last: If you have not implemented a copy constructor and assignment operator... (by jsmith)
How to add an image/C++ OpenGL?
 
Hi, I have been trying to look online for this and, so far, I haven't found anything useful. I would like to add a .bmp image to an OpenGL window. The lines ...
[3 replies] Last: I wrote simple BMP and TGA readers for use with OpenGL a while ago. T... (by Duthomhas)
why use #define?
 
Why not just put the number itself in?
[16 replies] Last: That reminds me I need to learn sorting alogrithms and linked lists an... (by chrisname)
Problem in String replace program's output
 
Hi all, I was trying to make a program which accepts a string and replaces it with another string accepted using pointers.The code following is error free but ...
[6 replies] Last: fgets(pointer to string, amount of characters, file); File will be ... (by chrisname)
October 2009 Pages: 1... 678910... 25
  Archived months: [sep2009] [nov2009]

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