General C++ Programming - August 2009 (Page 10)

Class, enum and #ifdef
 
Exercise 8 from Thinking in C++ Vol 1 reads (Chapter 7): Modify SuperVar so that there are #ifdefs around all the vartype code as described in the section on e...
[2 replies] Last: Many thanks for the response. I have run various amended versions of t... (by Peter1234)
Generic vs Solid Singletons: hiding dtor issue
 
Hi there, I have a generic Singleton which works fine: template <class T> class Singleton { public: static T& Instance() { static T _instance; ...
[5 replies] Last: So far I have just used the generic and solid Singletons separately .... (by Robertlzw)
fstream::getline() doesn't work while debugging (VS2008)
 
(i use VS2008) i'm having this weird issue where if i run my program in Debug mode, fstream::getline() returns an empty string ("")..if i run it in Release m...
[2 replies] Last: that was incorrect but you gave me insight and figured out that it nee... (by athlete501)
printer spooling
 
i am given an assignment with the following requirements Assume that a major printer company have outsourced their printer spooling software to your group. Y...
[5 replies] Last: If you wanted to use a name rather than just a char, you'd use a strin... (by kbw)
Class Stack
 
I got a problem with a program for Port Cargo Retrieval question. I need to create a 10 x 10 stack , 10 companies, 1 stack for 1 company. and would be able to ...
[2 replies] Last: well, it does print. But, it prints no matter what input i type for na... (by qi11qi11)
problem with stack
 
is there anyway to compare a stack with variable: example: if(name_temp==tempstack.top()) for tis, it doesn't works.
[4 replies] Last: i've posted my code on another thread, stack class. (by qi11qi11)
Passing the Pointer the wrong way?
 
Hey... I got the following Code void CStarField::Draw(LPDIRECT3DSURFACE9 Surface) { D3DLOCKED_RECT LockedRect; if(FAILED(Surface->LockRect(&Locked...
[4 replies] Last: 1. void CStar::Draw(D3DCOLOR* Pixels, int Pitch) { >>>Error Ma... (by Incubbus)
by RyogaH
Code 3 and char*-exception
 
Hello, I'm new here, so I hope I do this right and get along with everyone as good as possible. The Problem is, this Line of Code: [...] if(arg...
[2 replies] Last: Ah right, I threw a const char* by using "throw "Stuff"", thanks! Y... (by RyogaH)
.txt file data error
 
Hello, attempted a computer science degree at one time, then figured it wasnt for me, and now I want to be a paramedic. Anywho, I somehow got thru the first 2 c...
[no replies]
by Deimos
(Peculiar) Issue with std::map
 
Greetings fellow programmers, I'm going to head straight to the point. First of all, here's the full source: #ifndef __C_GENERIC_FACTORY_H #define __...
[4 replies] Last: I understand now. :) I had never used the STL classes inside my own ... (by Deimos)
How can I make my source code portable
 
Say I have for unix I have a header file that does some function that is implemented differently in windows( e.g. sleep), how can I make it such that my code ca...
[5 replies] Last: For compiler macros, see Pre-defined C/C++ Compiler Macros http://p... (by Duthomhas)
C++ Encryption/Decryption problem
 
Hello, I am trying to write a program that gives you 3 options: 1 for encryption 2 for decryption 3 Exits the program If option 1, my program will as...
[6 replies] Last: I have changed my coding completely and running into a few problems: ... (by ViperVenom)
NCurses Assistance Needed
 
Hello, I am getting an undefined reference to "" for all NCurses items. Let me give you my environment: gcc Code::Blocks Ubuntu 9.04 (Jaunty) NCurses ...
[5 replies] Last: Thanks for the linking tip. (by joehms22)
by hdiuy
Prompting the user to re-enter if entered value is not int
 
I got a little problem. The user is supposed to enter a number.But if the user accidentally entered a non number (like char) it'll prompt the user to re-enter t...
[4 replies] Last: Cool, thanks so much !!! (by hdiuy)
How to suppress the debug info from zthread
 
Hi All, When I was trying to practice multithread programming using zthread, I always got the output mixed with a lot of debug info like "1 user-thread added"(...
[no replies]
fopen giving error
 
Hi all I am trying to open a .par file with the help of fopen but the file is not getting opened. parfilename is passed as an argument to this, the value is...
[5 replies] Last: please post all your code~~ (by player6)
About Macro
 
Hi guys, there's a question about macro: Is there a macro can implement get the mininum number from 2 numbers, but the macro support the parameter with "++". l...
[1 reply] : No, the macros are stupid eg: #define MIN( a, b ) ( a < b ? a :... (by Bazzy)
Tic tac toe with AI
 
Hi guys, my assignment is to create a simple tic-tac-toe game with an AI as a C++ console application. I have my code done, but my teacher says he wants everyth...
[9 replies] Last: Hi guys, I saw another problem in the above code that me and my friend... (by meepokman)
Creating a variable while running
 
Hi, I want to know how I can create a variable while my program is running, and I want to name it while the program is running. Like I want to give it a type, n...
[12 replies] Last: good explanation bazzy (by robman8855)
Some Simple Questions
 
What is a library I think it is just a bunch of code but I can not be sure and what does a linker do exactly I think it connects libraries to your program but d...
[2 replies] Last: To find out about these, most of the info is in the C++ database on th... (by meepokman)
August 2009 Pages: 1... 89101112
  Archived months: [jul2009] [sep2009]

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