General C++ Programming - March 2012 (Page 32)

String to char array
 
Hello, I'm attempting to write a function that converts a string into an array of characters. This is for an encoding project I have to work on. However, my cod...
[2 replies] Last: c_str will return the char array of the string. std::string S = "Str... (by BlackSheep)
Boost program_options
 
I understand most, mostly. However, one of their tutorials has a compile error. I'll trim the code as much as possible: // Hidden options, will be al...
[no replies]
hashtable
 
guys im doing a report about hashtable...can u giv me an example, source code of hashtable in c++???please help me..tnx a lot
[2 replies] Last: ok..tnx a lot..how about payroll code?? (by kimberly)
making movement
 
hello I'm trying to make a pacman game, and the pacman needs to move (duh!). I'm trying to make it this way: void myIdle(){ glutPostRedisplay(); } ...
[4 replies] Last: I guess I would use SDL/SMFL to manage my keyboard inputs in accordanc... (by Azagaros)
by adn258
My Function To Convert Function To Char Array?
 
void Func_StrToAry(string strtemp, LPTSTR lptemp) { char* temp = new char[strtemp.size()+1]; temp[strtemp.size()]=0; memcpy(lptemp,temp,strtemp.size()...
[3 replies] Last: Memory wouldn't be left hanging since it's deleted on the fly as soon... (by cire)
Understanding the strcmp function
 
Hi, I'm currently taking a class and the instructor told us to use the strcmp function whenever we needed to compare strings, something like... if(strcmp...
[3 replies] Last: Thank you all for the good information. I found the problem why my co... (by fstigre)
Networking
 
Hello I am a sub-par programmer in c++, and I mainly work with Allegro and can make a basic game. So my question is (for future reference) Where can I learn abo...
[2 replies] Last: Thanks! (by Pirogun)
by ihmps
Reading files, using two instances
 
Hello, i want to know if someone can help me solving the following problem: The problem is: I do have a template class and I'm using two instances of the sam...
[2 replies] Last: template <typename ElementoPTR, typename Elemento> don't do that. Yo... (by ne555)
by jmrag
STL erase
 
hi i'm trying to write this program section below but while it compiles normally it stops responding when i run it. Pls help me.. i can't understand what is wro...
[4 replies] Last: Thx a lot man!!! You are my hero! (by jmrag)
Play sound while key is pressed
 
I am attempting to write a simple console based piano-type program. I need the computer to play a sound when a key is pressed and stop playing the sound when a ...
[no replies]
by LB
Graceful Polymorphic Serialization, but not Deserialization
 
I have some polymorphic classes and can *almost* gracefully serialize them with a virtual serialize member function that first calls the base class' serialize m...
[2 replies] Last: This is exactly what I am already doing, to every detail you describe. (by LB)
class function to display not working
 
student in need of help.. program has 2 classes, one to build object and another to build array of objects from first class.. i put cout<< in the constructor an...
[3 replies] Last: also the "problem" asks us to load the data for the InvBin objects for... (by C Theroux)
Easiest way to work with a database.
 
Hey everyone! This is my first post on the cplusplus forums! Woot! I need to implement a database for a prototype program that I am making for a school comp...
[2 replies] Last: The only reason that I was thinking it wouldn't work is because the ju... (by Randi Miller)
by m4wk
edit
 
edit
[5 replies] Last: edit (by m4wk)
Console Question
 
Is it possible to create layers in a console, like photoshop has different layers in a picture. I want to do something like Background filled with a certa...
[1 reply] : I don't think so. The console is VERY limited in capabilities. Prett... (by Stewbond)
Member function must be called or its address taken
 
I am trying to use rapidxml (the xml parser) but just testing one function makes the borland c++ builder (5) show this error message :"Member function must be c...
[1 reply] : Sorry, I don't know your answer. However there is another similar thr... (by Stewbond)
class Functions
 
Question: If you are designing a program that receives and returns (void/sets and return/gets), is it better to write individual void and return functions than ...
[6 replies] Last: Normally getters/setters are done with function overloading: int NameO... (by LB)
by Eyad
Correct please
 
Here is the Problem: Define a class for rational numbers. A rational number is a number that can be represented as the quotient of two integers. For example,...
[11 replies] Last: @Eyad Could you please post your input data, and what you get as outp... (by therockon7throw)
Calculating the maximum precision, some doubts
 
Hey there. Didn't find anything similar searching the forum so I'm posting this new thread expecting some help adressing minor questions about the numeric_limi...
[4 replies] Last: Many thanks for the paper, I studying it entirely. (by carlosbgois)
Polymorphism
 
How to implement a c++ program using arrays for the following scenario? The program is about student details wherein the program should display the name , id...
[1 reply] : #include<iostream> #include<string> // 1 you are missing this using ... (by Eyad)
March 2012 Pages: 1... 3031323334... 49
  Archived months: [feb2012] [apr2012]

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