General C++ Programming - October 2012 (Page 10)

Initializer lists
 
Hello, I am trying to initialize the base class. I would like to use an intializer list, but the class is not imediatly descended from the base class (there...
[4 replies] Last: > I could do this: Yes. That would be option_one. > I don't think i... (by JLBorges)
unable to start program
 
what can be the reason that i get this error while trying debugging?
[7 replies] Last: Main needs to be defined like int main() { } you may need to inc... (by Jackal16)
by BandK
Array...Question...
 
This is my code...How to put string in row and column of array that i want. I want that, when a user write a string, that this string stay in array...how to mak...
[1 reply] : Use indexes. For example X = "It is an example"; (by vlad from moscow)
Code::Blocks and Allegro
 
Does anybody know of a somewhat simple way to get Allegro set up fully on C::B 10.05? The files just keep getting errors even though the MinGW is the correct on...
[no replies]
C Pointers
 
Hi guys i've built a linkedlist library in C but am having some pointer confusion, when I call the create method below it seems to have no effect on the list th...
[7 replies] Last: Thanks works correctly now! (by Jackal16)
by cire
Feedback: Simple game engine beginnings
 
I've decided to make a small game for the experience. I have a project with a grander scope in mind, but I'm doing this first to familiarize myself with some o...
[2 replies] Last: Thanks. The definition of a "game engine" seems to be rather nebulous... (by cire)
by lmd141
Program stops unexpectedly
 
Hi, there's a problem I've been having for a while now that I can't figure out. I have the following function: void MCinsert(int &naccept, int &nreject, const...
[2 replies] Last: I should point out the problem seems to be with n_atoms. If I remove ... (by cire)
calculating with 2Darrays
 
i wrote a code reading inputs from a text file which has 5 columns and 75 rows.i need to calculate the euclidean distance of each element in a column. the co...
[no replies]
by BandK
Question please! txt file
 
Hi....I have question....How can i put course in right row and right column in txt file...Program ask User to add hour, Day and Name of course. I want to progra...
[no replies]
by shafh
Modifying from array to vector
 
I have currently trying to modify a code so a specific variable is a vector instead of a array. Im new to c++, so even though it is very simple I have had a ...
[5 replies] Last: no problem, and i didnt help at all but no problem haha. If you ever n... (by gsizzle10)
Write to text file - wrong character encoding?
 
I'm trying to write to a text file, and keep getting this error message: gedit has not been able to detect the character encoding. Please check that you are no...
[3 replies] Last: You win, Peter. I've been changing my code so much for the last 8 hour... (by closed account DEUX92yv)
1D array to 2D array conversion.
 
Okay so I have wrote this program that is like a mini-game. These were the requirements: Write a program that displays a 5 by 5 grid of dashes with an X that ...
[1 reply] : I think he meant to change declaration char row1 = { '-','-','-', ... (by vlad from moscow)
delete operator unable to free data
 
while(1) { newServ.ReceiveRequest(); char *recvBuffer = new char ; newServ.ReceiveData(recvBuffer, 4096, 0); delete recvBuf...
[7 replies] Last: why not use a static char array buffer to avoid new/free frequently? ... (by kbw)
std::bad_alloc
 
Every sixth or seventh time I try to run the program it works, but otherwise I get this: terminate called after throwing an instance of 'std::bad_alloc' what...
[8 replies] Last: Much better now. Thanks for your help. (by closed account DEUX92yv)
by abu
How to check if memory is alocated to a pointer?
 
Hi friends, I have a global pointer variable that can be called depending on conditions and not to reallocate the variable, i am using the method like, for x f...
[5 replies] Last: Try to use a debugger. For Linux - is valgrind, for windows - deleake... (by Banananas)
by shafh
vector push_back
 
Hey. Im currently trying to insert some objects into my vector. And to do this i think of using push_back (sound reasonable?) I try: int var; for (var = ...
[2 replies] Last: Hey cire. Argh you right. Why do i want node to be pointe. I don't. Bu... (by shafh)
How to convert 1 to 01?
 
I have an integer in a vector and I need to convert it from a single digit (1,2,3,...9) to a single digit with a 0 in front of it (01,02,03,...09). How would I ...
[6 replies] Last: Never mind , it happens sometimes :) And since you are newbie let me t... (by Maggi Iggam)
Understanding Iterator Question
 
Hello, I don't understand this question in the book I'm reading. Write a function void copy(int* f1, int* e1, int* f2) that copies the elements of an array o...
[4 replies] Last: Thank you very much I believe I understand it. So [f1:e1) means: f1... (by Jimmy Rose)
reading text file to a class type variable
 
i am new to c++ and i'm try to write a code that reads integers of a text file and saves each integer in different variables in a class.I am having problems wit...
[2 replies] Last: okay, i will reviewmy code again/ thank you (by iamtobey)
by sabi20
How to do ignore case on a strings
 
I'm trying to sort string array in ascending order but I'm having trouble getting to work right, because it puts the uppercase names on the top and lowercase na...
[no replies]
October 2012 Pages: 1... 89101112... 50
  Archived months: [sep2012] [nov2012]

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