General C++ Programming - December 2010 (Page 5)

How to create n-dimensional array?
 
Is it possible to create a multidimensional array without saying at the beginning how "big" it is, and specifying it later? I mean something like ciccio .....
[3 replies] Last: I fixed it up a bit, and even figured out how to keep the old data whe... (by PiMaster)
sort with char array struct
 
#include <iostream> #include <fstream> #include <string.h> #include <algorithm> using namespace std; struct word { char word_arr ; }; bool opera...
[4 replies] Last: Got it! (bool) 5 and (bool) -4 both returns 1. Thanks, ne555 and m4ste... (by nguyentrang)
opening a text file
 
hi, i've done everything according to this : http://www.cplusplus.com/doc/tutorial/files/ but i have a problem, if i open only one time my file, everythin...
[1 reply] : You might put a try/catch block around the second call to open() to se... (by kooth)
Class/Struct Within a class
 
this is my class: class Editor { public: static const int FeaturesAmount = 6; static const int MaxFeatures = 50; enum Feature { SpikesLeft, S...
[3 replies] Last: Ah, thanks alot, i completely forgot about that! :). (by Fatal Berserker)
A Simple problem, Need fast solution !!!
 
Ok my problem might be really stupid but i can;t figure it out and i am close to start pumping my head on wall :P The thing i want to do but it fails is that. ...
[7 replies] Last: Nevermind guys i found it. i just changed the gets(A .lastname) w... (by Sylphid)
Binary to Text
 
I was just wondering if anyone can help me out here. I made a program that converts text to binary code but I don't know how to reverse it to do the opposite(bi...
[2 replies] Last: Sorry with the delayed response. Lol I didn't know I was using a non-s... (by MouseofDead)
by LukeS
Insert data to beginning of file instead of end??
 
Hi, Everything I have read from searching online shows how to append to the end of a file using fstream and ios:app. I want to do the opposite, is it possible...
[5 replies] Last: [...] other fields that do not have set lengths so I can not just cre... (by ne555)
boost::thread ?
 
Have member function of a class I need to run in a new thread and an argument to it's parameter: class SomeClass { private: boost::shared_ptr<boost::th...
[4 replies] Last: Excellent, thank you! (by taylorc8)
Compiler Firewall Idiom - Accessing implementation from another class
 
This idiom seems to make more of a mess in my particular case than anything else. Consider the following code: class SocketAcceptor { class ISock...
[no replies]
Pacman!!!
 
Can somebody guide me making class hierarchy for pacman... how much class should i make.. n which objects..?? Please help me.. m not so much familiar with Game ...
[5 replies] Last: Actually OO design is pretty subjective. There is a hierarchy of cuz b... (by sohguanh)
by Phass
resizing vector error !!
 
I've got this in a class named Poblacion: vector<Individuo> population; In other class, I do some operations and I want to do: Poblacion pob; pob.po...
[4 replies] Last: Let's say you have a vector of Individuo with 2 elements. You call re... (by kempofighter)
Data member for different possible derived class objects
 
Hi everyone, I'm experimenting and trying to create a class that holds a shape object, where shape is an abstract base class. For example, consider a Purs...
[7 replies] Last: I see, that's clever. It makes me wonder if you're a professional ... (by thomas430)
by alej0
Columns in a txt file
 
Hello, im kind of new in c++, and i want to do the following: I have a txt file with 3 colums of data like this c1 c2 c3 1 4 5 1.2 43 0.9 0....
[2 replies] Last: wow I didn't know you could do that, thanks filipe! (by closed account 3pj6b7Xj)
gotoxy
 
in turbo c i am using a function gotoxy and delay under the header file <dos> can any one tell me about its equivlent in visul C++.. .plz need urgent...
[2 replies] Last: Also, obligatory link: http://www.cplusplus.com/forum/articles/28558/ (by Disch)
Copying a text file with executable file
 
Hi, I have one text file with more than 500 words. I wants to use that text file in my program, so as to copy that file to desired location while running the e...
[4 replies] Last: @coder777 Thanks thanks alot!! its very appreciable. thanks f... (by dearvivekkumar)
problem
 
int textInfo::get_wordCount(void) { int start; int i; int count; count = 0; start = 0; i = 0; while (i <= text.length()) { if (separator(text ) == t...
[5 replies] Last: @Slumdog: Don't cast the compiler errors. You are breaking the structu... (by ne555)
Is it possible to declare method pointers of abstract classes?
 
and then assign the value of those pointers with the address of the implemented methods of derived classes? Is it possible?
[5 replies] Last: ok thanks (by unregistered)
multiuse headers/classes
 
Hi guys, I am a fairly decent programmer in general, but still consider myself a noob (cos I odn't know stuff like this yet). Anyway I have a quick one for you:...
[2 replies] Last: To put it plain simple terms, use #ifndef mycode_h_ #define myc... (by closed account 3pj6b7Xj)
Inheritance problem with **pointers
 
Hello!;) i have been struggeling with a problem for a while. im making my own "API" in HGE. I do have a inheritance of classes. The base class is called C...
[2 replies] Last: Thanks for your fast reply!!;) NumButton* temp = NULL; temp = ((Nu... (by unknownProgrammer)
if statements with = in them
 
I have a quick Q. if ((q = p->from1) && (!p->from1->fq)) { in this statement is q being set to p->from1 or is it checking if q is equal to p->from1. ...
[1 reply] : q is being set to p->from1 (by Return 0)
December 2010 Pages: 1... 34567... 24
  Archived months: [nov2010] [jan2011]

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