General C++ Programming - September 2009

by sporx
writing words from txt to an array and remove duplicate
 
Hi, im working on a program that reads from a text document. the first line has a number, that suppo...
[2 replies] Last: #include <iostream> #include <fstream> #include <string> #include ... (by Fenor)
How excpose and internal stl collection as read-only in my API?
 
I have a collection, as an example, based of type std::vector<MyClass>. How can I create a collecti...
[2 replies] Last: Containment of an STL container is better than derivation since none o... (by jsmith)
by Duncan
Color Key Question (Alpha Gradient?)
 
Hey everyone. My artist wants to do a kind of gradient in his art for our simple 2D game. He wants t...
[4 replies] Last: The SDL_SetColorKey() function is for binary transparency (off or on).... (by Duthomhas)
Most random bug ever?
 
Heya! I'm currently programming in VC++ 2008 and I've come to face atleast to me the most random ...
[8 replies] Last: ic ic I was thinking this one was for language and concept type thi... (by turbozedd)
Why not cross-platform?
 
In certain occasions I might be able to understand. But when people write servers that are clearly a...
[4 replies] Last: In the environment I work in, if you can't test it, you can't say it ... (by helios)
open() method not working for multiple files.
 
Hello all, I am using ifstream to open a file. I have a loop that opens and reads from all of t...
[2 replies] Last: Awesome, that does the trick. Thanks Firedraco! (by flightdeck)
by PkD
friend class
 
Is it possible to do like this: class B; class A { friend class B int mA;}; class B : ...
[4 replies] Last: Yes of course you can use it and agreed buffbill it breaks encapsulati... (by behlkush)
GetPrivateProfileInt not working in windows 7
 
I am calling GetPrivateProfileInt (_T("SectionName"), _T("KeyName"), 0,_T("C:\\Documents and Settin...
[no replies]
delete char * in structure
 
My code keeps giving debug assertion error.. Here is my code.. #include "stdafx.h" #include "...
[13 replies] Last: It can still have a destructor. struct Test { char *value;... (by Chewbob)
by devas
pointer initialization
 
hi, i have some diffuculties in understanding a sample code: #define MAX 32 #define MIN 1 ...
[2 replies] Last: thanks a lot :) (by devas)
stuck on new school project
 
hey, I just started taking c++ and did the first couple projects ok but this one has me stumped. a l...
[5 replies] Last: Use code tags... the # icon on the right. Read your book, cin/cout ... (by turbozedd)
Opening file multiple times results in error
 
For this assignment, I need to create and populate a stack based on either user input (which works f...
[3 replies] Last: Thanks, I was planning on doing something similar later on-although I ... (by demosthenes2k8)
Khurram
 
Thanks mcleano, Could you please list me some free IDE's for writing C++ programs on? Regards,...
[4 replies] Last: MS-Visual C++ (powerful debugger, microsoft related ) Had to lol a... (by mcleano)
compare 3 objects and return 1, -1, or 0
 
i have 3 objects, first name, lastname, units done, credits earned well the all have different un...
[2 replies] Last: Put your student objects in an array or vector, implement the less tha... (by turbozedd)
Data Type Modifiers
 
signed, unsigned, short and long Why do data type modifiers only work on built in types? Why can't...
[6 replies] Last: Sorry: http://www.google.com/search?q=radical+language+modification (by Duthomhas)
Key Binding & Input
 
I have a very complex key binding and input system I have created that is for the most part hardcode...
[3 replies] Last: Yes, that would work as well, I think std::map's lookup is faster, but... (by firedraco)
Generate binary numbers
 
Hi, I am trying to generate all the binary numbers of length 3, and in order. I'm not allowed to use...
[2 replies] Last: Thanks Duoas! It did. I did it both ways, using your method based ... (by barneyTdino)
Contradictory results produced by sizeof
 
In a class, I have to define a constant member initialized in the constructor initializer list and a...
[3 replies] Last: Many thanks to Zhuge and Hamsterman for their comments. Hamsterman's c... (by Peter1234)
Reading Data into an Array
 
I need to read a large file into arrays but there are different conditions that i need to keep track...
[1 reply] : Hi! Firstly you should skip the first two line with getline instruc... (by screw)
by kwanlc
std::map segmentation fault
 
Hi, The following code works if I cross-compile it for one of my board using mips-linux-uclibc-g+...
[1 reply] : I am not shure, but you can try to use the following code: static ... (by Denis)
September 2009 Pages: 123... 14
  Archived months: [aug2009] [oct2009]

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