General C++ Programming - August 2013 (Page 10)

What're these used for?
 
Recently I was going through a bunch of old game's source code and I found some things I don't quite understand about how it works. I am aware this is used in a...
[4 replies] Last: That'd make perfect sense then. This game's workspace has over a dozen... (by mike70025)
SDL, and SDL_Rect
 
Hey guys, Working on a project with SDL in VC2012 express. I'm having an issue using SDL_Rect. Here's a snippet of code that I'm trying to implement : ... i...
[1 reply] : outside of a function you can declare and initialize a variable. Anyth... (by coder777)
std::thread arguments
 
Hi, I have a method: int filetodb(std::wstring szwf, SQLHANDLESTR *h); I want to use it, in a thread. std says, use thread, as: std::thread secon...
[2 replies] Last: ah yes, I haven't done this in a while! thanks, helios! (by hansaaa)
C++ LLL!
 
Hi all! I was just trying a simple c++ with LLL. I don't know why it adds data but when displaying, it shows nothing. Can anyone help? Thanks! main....
[4 replies] Last: By the way, stop shooting yourself on the foot delete ssn; delete s... (by ne555)
by Ceset
healthy ways of programming
 
lets say we have a class and we have 2 funcs in it. one of the funcs calling another both public. class ->func1 func1 calls func2 |------->func2 an...
[1 reply] : What do you mean by "healthier"? Which one is better? There's no way o... (by helios)
by Ceset
declared by function
 
MCLoad.h - MCLoad.cpp bool MCLoad::Load(SDL_Surface* Name, std::string File){ Name = NULL; Name = SDL_LoadBMP(File.c_str()); if(Name == NULL){r...
[14 replies] Last: yeah programmers need laughing and fun (by Ceset)
Hailstone Sequence if else if loop
 
My assignment is to write a program that reads in a number from the user and then generates the hailstone sequence from that point I'm not sure if I should use...
[2 replies] Last: I would do it like this: Have an integer, let's say x, and use cin o... (by Mats)
including own class instead of interrior class
 
I want to use FREAK(an opencv key-point descriptor library), generally speaking, a source file which exist in opencv or vc++, on the other hand i need to ...
[10 replies] Last: take it easy man, ok, i got it, thanks anyway (by hesam89)
data abstraction & problem solving with C++ (6th ed., Frank Carrano)
 
I am looking to for the Solution Book or help on the problems as follows: 1. The price of an item you want to buy is given in dollars and cents. You pay for ...
[no replies]
Having trouble with classes
 
I can't get my code to compile, i need to read in lines from a file and store them in variables. Then i have to construct instances of my class for how many lin...
[1 reply] : first : you declared a pointer to an object class(in your case P) P sh... (by closed account 28poGNh0)
Really Simple Quadratic Formula
 
First real program I've made completely on my own, still working on the c++ language but would love to know what you guys think and possibly how you would've go...
[1 reply] : Use <cmath> instead, the .h ones are deprecated. (by Codeez)
String COmpare
 
The Statement if ( "ben" > "BEN" ) ... result is FALSE will not give the same result with string name1 = "ben"; string name2 = "BEN"; ...
[4 replies] Last: THANK YOU VERY MUCH for all the Responses......It is now Crystal Clear... (by rosarion)
by manp
using a member function of a class in another class and relate it to an object in int main {}
 
I am writing a program which is using SDL library. I have two different classes which one of them is Timer Class and the other is EventHandling Class. I n...
[4 replies] Last: Thanks a lot, It was a nice hint. I could manage to use your solution ... (by manp)
C++ OpenGL, good game programming tutorial?
 
I was wondering if anyone knows a good (and working), simple OpenGL C++ game tutorial. I have tried these one's so far, i will state why they haven't worked. ...
[9 replies] Last: haha, I actually didn't, but I thought it was funny. I haven't seen a... (by Disch)
palindrome recursive
 
bool is_palin(string temp,int begin,int end){ cout << temp << " and " << temp <<endl; if(temp != temp ) return false; if(end-begin <= 1 ) return tru...
[2 replies] Last: A recursive function essentially constructs a loop of calling itself a... (by jmadsen)
Data Structures
 
So I'm about to start a class in college on Data Structures, I was wondering if anyone can throw in any information on the subject so I can start research in my...
[6 replies] Last: Vectors are great, just remember to not use "resize" at all. Back to... (by cire)
by helios
Exceptions vs. error codes
 
Suppose you have a function like this: /*...*/ implementation_function(const std::vector<parameter> &params){ //... check_parameters(params) //...
[12 replies] Last: Computergeek01: Is this a real world problem or just a thought experi... (by helios)
Help with code.
 
Hello guys, I need help: Let's say that in a txt file named hot.txt, I have this: 12,23,32 And with ifstream I want to take those number, adding one by one ...
[6 replies] Last: Ok Got it! I didnt know that, Thanks a lot! (by jmyrrie)
recursive problem
 
int sub(string &temp,int begin,int end){ if(end-begin == 0){ return temp ; }else{ return sub(temp,begin+1,end) + temp ;} } i want to a...
[8 replies] Last: int sub( const std::string &s, std::string::size_type pos, std::strin... (by vlad from moscow)
Irritating algorithm?
 
Hello! It's me, working on another homework assignment. I've been at this one for almost 4 hours now and I can't figure it out. Here's the assignment: A ...
[5 replies] Last: Well, i am not into these types of financial calculations, but the pr... (by SwimToTheDeath)
August 2013 Pages: 1... 89101112... 28
  Archived months: [jul2013] [sep2013]

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