Beginners - August 2014 (Page 14)

by Zedd
Meaning of variable declaration
 
I am a beginner in C/C++. I have used this declaration several times : <data type> <variable name> = value. For example: float angle = 0.0; But I r...
[2 replies] Last: Thanks a lot (by Zedd)
Modify rainfall program
 
Hello, I have to modify a rainfall program that I have previously made last quarter, and make it display a list of months sorted in order from high to low and I...
[1 reply] : Google bubble sort or insertion sort. (by Cody0023)
Overloading Function
 
Here I have this class and am trying to calculate a distance and I keep getting an overload function error. I have tried type casting, and have tried solving t...
[6 replies] Last: Whenever you get an "ambiguous call" type error, you need to explicitl... (by helios)
Classes - Data Member Help!!
 
I've been trying to figure out this error for a while and am totally blanking on what is going wrong. I keep getting a data member initialization error. Below...
[2 replies] Last: DUH! A constructor!! Thank you!! (by giraffe1234)
by Ganado
System calls abuse, and prevention
 
I've seen it written sometimes in various places that using a system() call opens a "gaping security hole" or has the "potential for abuse", something along tho...
[5 replies] Last: Yeah I would suggest using the native ones since system just calls the... (by giblit)
Please explain how pointers and references work
 
So I'm learning about pointers and references and this tutorial http://www.ntu.edu.sg/home/ehchua/programming/cpp/cp4_PointerReference.html is great. However, I...
[2 replies] Last: http://www.parashift.com/c++-faq/references.html In modern C++ you ... (by wh1t3crayon)
Can one functon gets a value from other function and use it?
 
Hi, is there any way to get one function to return a value and other function to use it? Thanks. #include <iostream> using namespace std; int Squar...
[4 replies] Last: Thanks. I think i understand. (by lucan74)
is pointer notation useful
 
General question here. My book shows me the "pointer method" to display an array. Are there any advantages to using this method? I know pointers are importan...
[2 replies] Last: Thank you! I am going to have to start using the phrase "syntactic sug... (by heyyouyesyouiloveyou)
by LGOOZ1
++ operator overloading - please explain
 
I'm overloading the ++ operator with the following code in a sample class I wrote. The code seems to work fine. Flower Flower::operator++(int) { Flower te...
[13 replies] Last: Who needs? Well, most of the time you could write: y = x; ++x; But... (by keskiverto)
Results of a call
 
If a =17 and b=3, what will happen if I call fi(a, b)? void fi(int& a1, int a2){ a1 /= a2; a2 += 2; a2 = a1 % a2; } I tried to call it by saying x=1...
[14 replies] Last: Notice that a1 is passed by reference, but a2 is passed by value. ... (by dhayden)
by LA101
Dynamic memory - adding a new item at the end of an array
 
I am writing a program that reads values from a text file, (a sequence of points), stores it in a dynamic array and then prints it back. I am not allowed to us...
[5 replies] Last: Thanks! (by LA101)
Initialize the array inside the class
 
Assume I declare an array in the class header file: class A{ private: int a ; }; Then I try to initialize it in constructor. It seems I can only ...
[2 replies] Last: If the values are magic numbers (i.e. their definition is completely a... (by helios)
input on eclipse
 
Hello i am using Eclipse and don't know how to test my program when i use cin for example when my program is running, type in a number. does anyone know how th...
[4 replies] Last: It is me who is inattentive, i found out thanks for the help :) (by Jacobhaha)
by ammarh
How to make that program?
 
Write a program to enter the number till 100 till the user want and at the end it should display the count of positve and negative and zero entered
[4 replies] Last: I could help you, not write the whole program for you, but sure i can ... (by Markxz)
User input and classes
 
I only have basic understanding of c++. I was wondering if someone could help me figure out how to get the user to input the velocity values themselves and then...
[1 reply] : http://www.cplusplus.com/doc/tutorial/basic_io/ You simply get input ... (by keskiverto)
Loop Exercise
 
Hello. I would like a review of my attempt at one of Bazzy's beginner exercises. Exercise Write a program that ccontinues to asks the user to enter any nu...
[3 replies] Last: Thank you dhayden. (by Bogeyman)
How do I use this png loader?
 
Hello. I'm a newbie in c++ and opengl programming. Can someone explain how this png loader works? I just want to know how to use it. Thank you. http://afshar...
[1 reply] : Can someone explain how this png loader works? I just want to know ho... (by Disch)
Initializing variable
 
Hello, sorry for this silly question. I'm really new to C++. I really want to know why can't i get the summation from 50 to 100 when i initialize the "sum" vari...
[4 replies] Last: ok, i think i got it. thanks for ur reply! :) (by Necrophagist)
by Nison
Arrays.
 
I know what this does, but i don't understand how it does it. int nArray ; for(int& n: nArray) { n = 0; } I understand that n is being referenced to...
[2 replies] Last: http://www.codesynthesis.com/~boris/blog/2012/05/16/cxx11-range-based-... (by keskiverto)
by Tink
Blank Default Case in C++ Switch Statement
 
Thank you in advance for sharing your knowledge! I am working on someone else's C++ code (cannot share the code here for legal reasons), and they continue to...
[3 replies] Last: I sometimes do it to avoid compiler warnings. If you use the GCC fla... (by Peter87)
August 2014 Pages: 1... 1213141516... 40
  Archived months: [jul2014] [sep2014]

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