General C++ Programming - March 2011 (Page 27)

by elfico
practice problems
 
Hi every one. I have been learning c++ on my own and I think am doing well. But my problem has been that I have not been having a lot of exercises to practice. ...
[1 reply] : Here are some simple exercises: http://cplusplus.com/forum/articles/12... (by Bazzy)
I Need Experienced Advice!
 
First let me state that I am interested in learning C++ because I want to be a computer programmer. I have taken a semester on Java in my school, so I am not a ...
[2 replies] Last: Since I'm German I can only refer you to some other more advanced Engl... (by thokra)
How do I Suppress a Warning in Xcode?
 
I have a function that computes a power of -1: int negOneToTheXthPower (long x) { if (x % 2 == 0) return 1 ; else if (x % 2 == 1) return -1 ; } Buil...
[1 reply] : the easy solution is to just get rid of your redundant condition: ... (by Disch)
Undefined reference to constructors and destructor.
 
I'm having some trouble with a class I'm writing for my midterm. For some reason, I wrote out the constructor and destructor and I'm getting errors when I compi...
[12 replies] Last: +1 firedraco. There's nothing wrong with public data members. This... (by Disch)
Error: Expected primary expression before else
 
I am a beginner student learning to use C++ programming. My assignment is to create a program regarding shipping charges. There are three different shipping ser...
[3 replies] Last: When making elses and else ifs, you must put them directly after the c... (by firedraco)
cout format problem
 
i want to print a list of format like the following: NO WORD COUNT 1 abc 1 2 abc 7 but as no, word, ...
[2 replies] Last: Hello if you are using the gcc-g++ compiler as in Linux then you could... (by mikeofthenight)
The "best" way to return an aggregate value?
 
Hello, I'm new to the forum. I'd like to get this straight: When you return, say, a class object from a function by value, in principle (depending on the ...
[10 replies] Last: Sometimes you just have to use C++ instead of Java. For example, if yo... (by mmikkone)
by fafner
Qt undefined reference to vtable
 
I'm writing a simple, simple Qt app, and I'm getting the useless "undefined reference to vtable" message from g++, and I have no idea why. I have one class whic...
[6 replies] Last: @fafner: You're using the Q_OBJECT macro. This macro is define in qobj... (by thokra)
allegro collision need hlp
 
please people help me, i have spent the last 9 hour googling and trying to get my collision to work but nothing. i tried everthing and nothing works please help...
[no replies]
by thokra
Dependency injection and very mighty classes? Right choice?
 
Hi folks! Since I'm currently implementing a Core OpenGL based rendering engine as a library, I find myself confronted with a very common design issue and th...
[no replies]
by venot
how to write a program for this ?
 
write a program that prompts the user to input an integer number and then output the number with the digits reversed . For example if the input is 12345, the ou...
[7 replies] Last: roger that . i'll show this to him asap (by venot)
by venot
does anyone know how to correct it with a correct coding
 
//debug6-2 // user enters price // program computes tax rate // 5% at prices $10 and under , otherwise 7% #include<iostream> using namespace std; int ma...
[3 replies] Last: Once again... what's the problem? How can we help you if we don't know... (by packetpirate)
Creating a memory manager
 
Hello forum, I need to make a custom memory manager, and I think I have grasped the concept, I need to allocate a block of memory up front and then hand out ...
[5 replies] Last: @MintBerryCrunch I did ask, because I have been taught this the oth... (by simeonz)
Calculate the ideal block size
 
I'm writing a program that has to write a list of files into a single file (kinda like an archive), with no compression, and write a list of the files at the to...
[2 replies] Last: Bigger would usually be faster because you'd do less reads and less wr... (by chrisname)
copy constructor with templates
 
Hi All, I had some issues with implementing copy constructor using the templates. I had tried to implement a small program to check the functionali...
[1 reply] : For template classes/functions, you must put the definitions (the stuf... (by firedraco)
get file/folder properties in linux
 
hi, i want to know is file/folder is hidden or not, in linux. i open folder using opendir function, and traverse using readdir function. For every file/f...
[8 replies] Last: thanks everybody for help)! i have one more question, it is about ... (by akmal4ik)
Fstream binary question
 
I can't figure out how to add 5 to every byte, and not just the last value in the Loan object. Loan Objects: that were written to the binary i/o file // In...
[8 replies] Last: One approach is to use flush: // Then I will write result to anoth... (by simeonz)
Looping Questions
 
here are some question i don't understand please some one explain to me. Im new to C++ im sorry. Thank you for your help. 1. What is the output of the follow...
[6 replies] Last: @demonkyo3 If it work in the first place i wouldn't have a problem... (by king214)
by sever
Scopes problem...
 
Hi, My compiler replies me with an error that I don't know how solve. It says me that "A is not declared in this scope" I've an structure, struct A { ...
[3 replies] Last: Sorry, I may have been unclear. Get rid of line 17. If struct A is... (by Disch)
complex number using structures
 
Complex numbers have the form realPart + imaginaryPart * i. Both realPart and imaginaryPart are integers. Write C++ code below to define a complex structure wi...
[2 replies] Last: Do you have a question? What don't you understand? What do you hav... (by doug4)
March 2011 Pages: 1... 2526272829... 31
  Archived months: [feb2011] [apr2011]

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