General C++ Programming - January 2012 (Page 19)

by Mat001
rand() and if statement
 
Hello all, I'm writing a piece of program where I use '1 + rand() % 10' to generate numbers between 1 and 10. Rand() function is followed by an if and if else ...
[3 replies] Last: Awesome!! Thank you, guys. You were both right. The true/false condit... (by Mat001)
'friend' is quickly becoming an enemy.
 
I'm having some issues with the friend keyword...and I'm pretty sure it has to do with the C linkage that I'm forced to use. Error below, and code that generat...
[1 reply] : Try moving the function declaration above your class definition. (by closed account DSLq5Di1)
SOMEBODY PLEASE HELP!
 
This program is suppose to calculate the median from a file containing 14 integers separated by spaces. The program doesn't work, it output a negative number as...
[7 replies] Last: vin, you are right. But if the count variable is wrong it is still the... (by Peter87)
by charij
Trouble with an iterative algorithm (maybe memory allocation)
 
Hi guys, I'm trying to implement an iterative algorithm that generates and fills a tree structure and then prints out the contents. Each branch of the tree bei...
[5 replies] Last: I think that is what the problem is. So in the root nodes, set the va... (by thepedestrian)
by Laveer
Simple Question
 
Well the bit of code I'm about to show makes what I'm trying to do self explanatory : void Form1::label3_Click(System::Object^ sender, System::EventArgs^ e...
[4 replies] Last: Figured it out, I had to put it on the checkchange event. Thanks @ nar... (by Laveer)
by Laveer
Unchecked checkBox event?
 
Er, this is rather embarrassing.... Though I've tried everything :l You can for Ex. do this : if(checkBox1->Checked) though in the event that you want it to...
[7 replies] Last: @codykiddy Thanks a bunch! (by Laveer)
For loops challenge
 
i have created stairs using my code however i need a character to move up the stairs using keypress here is my code so far: CursorController crs; int N...
[no replies]
by Floryn
Sum and product of polynomials
 
I am new to c++, and I would greatly appreciate the help. This is what it was given to me, and I have to do the sum and product of the polynomials. Here is the ...
[8 replies] Last: bump. (by Floryn)
Binary to decimal progam
 
Hello im writng a program that converts binary to decimals. i feel like im doing this all wrong considering its not working right.any help would be great! ...
[3 replies] Last: There would be a problem with "dec", since that is used by std, unless... (by closed account o1vk4iN6)
Reducing fractions program
 
Hello, im writing a program that takes in a fraction i.e 4/6 and find the gcf of 2 and then outputs 2/3. ive already written some program for this. (so im not e...
[4 replies] Last: thank you. one more question, how do i get the answer to come out as... (by Morgan Huguelet)
by ToniAz
WCHAR and LPCTSTR
 
Hello Everyone! I know LPCTSTR is a long pointer to a null terminated string, but is this string a regular char or a wchar_t ? i.e. is LPCTSTR equivel...
[3 replies] Last: Million thanks for you,webJose.Very detailed and extremely useful guid... (by hentaiw)
Lost at storing classes in different files
 
Ok, this is one thing which since i started using C++, ive wanted to do, but spend all my time trying to get to work that i never actually program anything. ...
[5 replies] Last: Thankyou, ill read up on this. (by Fatal Berserker)
C++ Questions
 
Hi I am new to C++ but as I am learning i would like to know a few questions... 1.Will http://www.cplusplus.com/doc/tutorial/ teach me the whole programming ...
[5 replies] Last: I hope you succeed man! The younger you start the faster you learn ;D ... (by xander333)
matrices issue
 
i have a program that i am doing that i have to confirme some numbers in matrices. this is my main matrix: coluna=0; j=0; SetConsoleTextAttribute( h , K+...
[2 replies] Last: no, i forgot to meantion that the n and m are int n and m because ... (by DannyPt)
questions on efficiency with OpenGL
 
I am trying to write a program using OpenGL and I have a couple questions about efficiency. First, what is the difference (in efficiency and memory) between dra...
[2 replies] Last: OpenGL (on decent hardware) is VERY fast. I'm not sure if we have a un... (by ModShop)
Need help with a project! I/O streaming
 
Hello there everyone. First of all i am new to the forums. I have been reading this forum since last year and i like it. I need a help with a project that i hav...
[10 replies] Last: Sorry for the late reply.. you are supposed to do this. for(i=0;i<... (by Pravesh Koirala)
Pointers
 
Can someone tell me how the size of a pointer changes when it is pointing at, say, a single long integer and when it is pointing at a dynamically declared array...
[4 replies] Last: Thanks guys. That's really helpful. (by Aaron Hanna)
by mhvrac
eclipse: undefined reference to `NR::sort(NRVec<double>&)'
 
This is straight from Numerical Recipes in C++. But hitting snag in eclipse: Problem: Description Resource Path Location Type undefined reference to `NR:...
[3 replies] Last: Stewbond, bluecoder, thank you for reply. I get same error if I repla... (by mhvrac)
Stringstream causing core dump.
 
I have a C++ shared object library that I am calling from an OpenEdge (Progress) application. The program makes library calls to a C++ function that uses the "...
[1 reply] : The problem was related to conflicting included libraries. I had copi... (by Boomn4x4)
by Una
Array of pointers to elements in a linked list
 
Hello all, I'm trying to implement a data structure consisting of an array of link lists, where each element (value from a given range [1..N]) can appear onl...
[2 replies] Last: Thanx for your reply. I found the mistake in my code. I did not use ... (by Una)
January 2012 Pages: 1... 1718192021... 36
  Archived months: [dec2011] [feb2012]

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