166 Posted Topics
Re: What is the problem you're having? Are you getting freezes? NULL-pointer access? Just some general crash? Is it not compiling? | |
Re: You're trying to set GLPoint P, Q, R, and S to just a set of numbers in parenthesis, and your compiler doesn't know what to do with that. You're going to have to make an intializer list of setting these, or if you want a quick and dirty method of … | |
Re: I know that running a program through an environment such as Visual C++ or CodeBlocks will automatically set the working directory to whatever you choose, if you set it up correctly. Your IDE is probably set up to always run your Debug program straight from the /bin/ folder, but when … | |
Re: It looks like Python is more similar to C++ than Perl. Perl has some strange syntax that allows [I]if[/I] statements [I]after[/I] the command, and it appears that a lot of variables in perl don't have any real typing, and it varies with how you use them. Python is syntatically more … | |
Re: You mean like converting a character into a usable input? Like pressing 'Q' to get "Quit game" and whatever? My knowledge of <stdio.h> is better than my knowledge of <iostream>, so I'm sorry if it seems too oldschool. [code=C++]char input = getchar(); if(tolower(input) == 'q') { //Code to quit game … | |
Re: You're going to have to swap each string manually, character by character, if you're going to want this to work. | |
I'm a rather experienced, self-taught C/C++ programmer. I go by the name Tum in other places and I am involved in SDL game design. I am happy to help people with their coding problems when I can. | |
Re: On all of those cases where you commented "to be filled", you should put a "break;" statement after each one or you're going to get problems later on. | |
Re: Are you sure it's your *compiler* that's crashing? Or is your program crashing during execution? If it's the latter, it's more than likely that "r" is pointing to invalid memory or "r" is a NULL pointer. | |
Re: The main() function is not allowed to be called inside a program. As far as I know, this means no function pointer is allowed to point to it either. I'm sure your results may vary from compiler to compiler. The only sure way is to try it yourself. | |
Re: More than likely, it's just because printf() and scanf() are functions that have been around since before C++ and if you were to disallow that suddenly, it would cause older code to no longer compile correctly. Plain vanilla C didn't have all the type-safety that C++ had, and IIRC enum-int … | |
Re: The pow function takes two doubles. x and y were declared as integers. When you put two integers in the pow function the compiler doesn't know what to do. You have two choices. You can either declare x and y as type "float" or "double" instead of "int", or you … | |
Re: Game Maker is actually pretty slow and inflexible, but I guess that's the tradeoff you have to deal with for ease of use. I've had to deal with Game Maker myself when I was making amateur games and even their built-in collision detection functionality was broken for objects that moved … | |
Re: As long as that part of the input will always be a single character, yes, you will be able to do that. Also, if you want to make your code shorter, I believe fscanf returns the number of arguments filled, so you could fill multiple data element with a single … | |
Re: <string.h> is a C-compliant headers that provide functions for comparing, copying, and doing other things to arrays of characters (For example, "char* foo" or "char buf[128]"). strcmp(), strcpy(), and whatnot are included from there. They actually don't do anything with the "string" class. <string> is for C++, and that is … | |
Re: I really wish people would stop recommending system("pause") . |
The End.