General C++ Programming - July 2011 (Page 6)

using a FSM for game states?
 
I just learned about FSMs from a website, and thought they'd be fantastic for managing the various states of a game (Menu, Start, Instructions, etc). Would this...
[2 replies] Last: Interesting.. I figured they'd have pretty wide applications, just by ... (by pabloist)
Strange Assertion error.
 
I set up a string list like #include<string> #include<list> std::list<std::string> mylist; This is created inside another class/object, which isn'...
[4 replies] Last: for some reason I expanded the code a little bit, cleaned the build a... (by Azagaros)
Can't seem to get this code to work.
 
Hello Everybody I been learning by myself C++ programming for a month now and I'm now taking classes to learn more about it and how to use it. My teacher ga...
[2 replies] Last: Various other things you should seriously re-think. short studen... (by Turbine)
Linking C and C++ files
 
Hi all, I'm actually working with CUDA to link .c and .cu files with nvcc, but since nvcc just treats .c files like C code and .cu files like C++ code I thou...
[no replies]
mismatch in parameter list
 
I am trying to design a program which contains a function which returns and outputs the smallest element in an array. When compiling the following code, I get t...
[2 replies] Last: Thanks, hamster. I see the error of my ways in terms of the variable d... (by richkidd77)
Invalid use of class error
 
While I understand this is a relatively common error among new users and students of C++, I have had no luck finding out why my specific code is giving me this ...
[4 replies] Last: Okay, thank you everyone! (by Casey Ferguson)
C++Challenge for all Programmers of the Programming World
 
Hello Programmers, I have a TicTacToe source code that I want everyone to finish. It is challenging for beginners but it will be fun to complete. Let's see how...
[6 replies] Last: It could be a phone application. (¿why they invert the digits?) [co ... (by ne555)
Writing my own malloc
 
Hi, I am reading K&R of C about the storage allocator. Here they are defining malloc but i am having some problems in understanding it. Why do they do nun...
[2 replies] Last: The statement is working out the number of blocks - of size sizeof(Hea... (by andywestken)
What kind of statment or basic structure should i use here?
 
#include <iostream> #include <cstdio> using namespace std; int main (int nNumberofArgs, char* pszArgs) { int a=1; int b=2; int c=3; ...
[3 replies] Last: you should try googling this stuff first. To make a character array yo... (by ceruleus)
by teocl5
cppunit testing
 
I have no idea on what is cppunit testing. How do i start doing it? I have this code here. How can i do cppunit testing? #include <cstdlib> #include <ios...
[1 reply] : http://lmgtfy.com/?q=cppunit+sample (by agile)
Runtime error in destructor of memory pool
 
In the following program, I got runtime error (program hangs) from template <typename T> MemoryPool<T>::~MemoryPool(). I suspect that it has something to do wi...
[3 replies] Last: agile, thank you very much. Your suggestion works and your explanation... (by Robertlzw)
by agile
C++ and design pattern online test, free!
 
http://www.interqiew.com/ Enjoy!
[no replies]
Help with getopts_long()
 
I'm trying to use getopts_long to process command line arguments. I need to setup an option array to pass to getopts_long. But when I compile I get the error. ...
[1 reply] : The type of a string literal is const char* so if you change it to t... (by hamsterman)
Extending the string class
 
What would i have to do to expand on append operator+= . where i can add int,long, and etc. so i don't overwrite string append method. This is what i have ...
[2 replies] Last: NEVER DERIVE FROM STD::STRING!!! Generally, it is a very bad idea to d... (by aquaz)
by alhanz
Loop? Problem in Login features..
 
Hey guys, I got a slight problem here which I can't solve it. I made a login feature which requires user to enter their id and password . After enter his...
[2 replies] Last: void Login::loginMenu(){ string idInput; string pwInput; ... (by hamsterman)
Amount validation
 
hi all, can anyone enlighten me on this? i need a validation function that must only take in 'numbers' and '.' for example the amount i want to enter is 9...
[2 replies] Last: Declare 'inc ' as a double then write the double val_income(double in... (by buffbill)
How can I input decimals into my calculator?
 
I'm trying to write a calculator where the numbers are entered from right to left. In order to accomplish this task, I've put together the following code by sea...
[1 reply] : The four functions (+,-,*,/) are all written for int types and this is... (by buffbill)
by madjas
what is wrong with my code???
 
#include <iostream> #include <string> using namespace std; ostream & operator << (ostream & outs, PhoneList & list); class PhoneNumber { publi...
[2 replies] Last: What on Earth is THIS??: PhoneList(} on line 34. Just correct these ... (by dams)
by JDong
list::sort comparator help
 
Hi everyone, I am having trouble with sorting lists. I read the article on this website about list::sort but I can't get it to compile as I wish. Here is ...
[5 replies] Last: Yes, there are. But they are of no use here. If I wanted to make my ... (by m4ster r0shi)
how to declare dynamic struct
 
#include <iostream> using namespace std; struct test { int a; int b; }; const int size = 10; int main() { test *p = new test ; // ????...
[1 reply] : If you mean that you want to create an array which's size you don't kn... (by R0mai)
July 2011 Pages: 1... 45678... 30
  Archived months: [jun2011] [aug2011]

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