Posts
 
Reputation
Joined
Last Seen
Ranked #270
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
93% Quality Score
Upvotes Received
106
Posts with Upvotes
98
Upvoting Members
78
Downvotes Received
8
Posts with Downvotes
7
Downvoting Members
7
34 Commented Posts
~259.38K People Reached
Favorite Tags
Member Avatar for din_hilmi

I wrote something for this and if you want to put in more numbers its really easy (not as easy if you would just use arrays) if you read the code and see what I'm doing. [CODE]#include <iostream> using namespace std; int main() { int n1, n2, n3, n4, n5, …

Member Avatar for Aditya_47
0
44K
Member Avatar for daniel955

Here is a method using recursion that you could use. If you would want this to work with rocket mania then you would need to do checking to see if the two pipes line up rather than just replacing the character like the function does below. [CODE=C++]#include <iostream> #include <cstdlib> …

Member Avatar for Nisa_1
0
516
Member Avatar for restrictment

Would look more like a circle if the characters were square and line spacing was the same as character spacing. [CODE]#include <iostream> using namespace std; int main() { double r = 1.2; for( double y = -r-0.1; y <= r+0.2; y += 0.1 ) { for( double x = -r-0.1; …

Member Avatar for CharlieCap
2
2K
Member Avatar for nightcrew

This sounds like a trick question to me because if n was 50 or something and I gave the input 20, 30, 21, 49, 1, 35, ... 0 how would you be able to sort that without having a variable for each input. To "sort" a bunch of input in …

Member Avatar for omgerg
0
3K
Member Avatar for PulsarScript

You can use `System.IO.Directory.GetFiles(DIRECTORY_NAME);` which will return an array of strings that contain all the files (with full path) in that folder.

Member Avatar for sfuo
0
200
Member Avatar for choconom

I am not a Unix/Linux user so I am not 100% sure but after reading [on GetOpt here](http://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html#Using-Getopt) and [a GetOpt example here](http://www.gnu.org/software/libc/manual/html_node/Example-of-Getopt.html#Example-of-Getopt) I would say the short answer is you must write `myprogram.c -t file1 file2 file3` because it parses for options first.

Member Avatar for rubberman
0
174
Member Avatar for CJMW

I know this is a bit late and you may have come up with a solution already but here is a method you could use. pbGameBox is a PictureBox object from the C# Toolbox. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; …

Member Avatar for sfuo
0
2K
Member Avatar for andrew mendonca

Line 18 of what you posted makes no sense. It will always select maximum = maximum in the trinary operator and you cannot declare a variable equal to an undeclared variable (even if you could it would be holding a garbage value). Line 19 you are now saying that the …

Member Avatar for sfuo
0
383
Member Avatar for gangsta gama

I would suggest that you do not try to store all your information in labels, but rather have seperate variables that control the amount of each stat that your character has and then display those values in the labels. I tossed together a quick example of how you can use …

Member Avatar for gangsta gama
0
377
Member Avatar for glao

Not sure why you are switching values in the b array or why your swap function uses loops. #include <iostream> using namespace std; int main() { const int N = 3; double *a = new double[N*N]; double *b = new double[N]; double *x = new double[N]; a[0] = 9; a[1] …

Member Avatar for glao
0
208
Member Avatar for hira_5

Do you mean the constructor? You make a public function within the class that has no return (not void) and also has the same name as the class. #include <iostream> using namespace std; class Square { int _side; public: Square(){}; Square(int side) { _side = side; } }; int main() …

Member Avatar for sfuo
0
115
Member Avatar for krieg

Line 17 should be `display->array = (char **) malloc(sizeof(char*) * height);` Note that it is `sizeof(char*)` not `sizeof(char)` because you are trying to allocate char pointers which have a size of 4, where a char has a size of 1. Also your display function will not work as intended because …

Member Avatar for krieg
0
347
Member Avatar for sfuo

This is a timer class that I wrote a while ago (cleaned up a bit for the snippet) for adding delays in some of the games I have written over the years. Note: I normally have the class functions in a .cpp file but since it looks like I can …

Member Avatar for dexblack_1
0
12K
Member Avatar for priya.chitroda

Show us what you have done and we can help you if you state what problems you run into. We will not just do your homework for you.

Member Avatar for james.opdyckeii
0
125
Member Avatar for Israel_1

If your function is always going to be composed of `A*x^0 + B*x^1 + ... N*x^n` then why don't you integrate the function analytically and then evaluate it at the bounds x1 and x2 and subtract them. example: `f(x) = 10x - 5x^2` `x1 = 1, x2 = 5` `int(f(x)) …

Member Avatar for Israel_1
0
1K
Member Avatar for sireiz

`int compare (const void * a, const void * b)` The two values 'a' and 'b' are of type void pointer and we want this function to compare two integers so we must convert from void pointers to integers. To do this we first cast the void pointer into an …

Member Avatar for sepp2k
0
2K
Member Avatar for kemkoi

If you are looking to make games I would go with C++/OpenGL or C++/DirectX or C#/XNA. I have never used C# but since it is a newer language and since it was made by microsoft it would probably be very easy to make windows programs and games using their XNA …

Member Avatar for amanahad
0
320
Member Avatar for codeyy
Member Avatar for Icekilla
Member Avatar for Adak
0
172
Member Avatar for Vish0203

strcpy() works with c-strings and those are arrays of characters that have a '\0' terminating character. You are using a C++ string and they have the '=' operator overloaded so you just have to write string1 = string2; and that will copy the contents of string2 into string1. I would …

Member Avatar for rubberman
0
205
Member Avatar for kar0x

If you are new to game programming then you should start with a 2D game. There is a massive gap between 2D and 3D if you plan on writing any of your own code (physics or other engine elements).

Member Avatar for kar0x
0
167
Member Avatar for dreday92

If you have the function prototypes within the class and you want to define them outside, you need to define them with the proper scope. Right now you are just declaring some functions in the global scope. To define the class's functions you need to include the scope of the …

Member Avatar for sfuo
0
106
Member Avatar for Carpetfizz
Member Avatar for breezeonhold
Member Avatar for brian71289

If you were to throw `return user;` at the bottom of your function the error would go away. This is because if for some reason it did not go into your using statements it would never see a return statement.

Member Avatar for gusano79
0
255
Member Avatar for streetalex310

If you don't want to use the table you can just use a program to print out what the char for those hex values would be. #include <iostream> using namespace std; int main() { char message[] = { 0x4B, 0x50, 0x7B, 0xF1, 0xF4, 0xF5, 0x5E, 0x50, 0x7B, 0xF1, 0xF4, 0xF5, …

Member Avatar for WaltP
0
150
Member Avatar for streetalex310

You obviously didn't read the other thread that you started. I posted code that would output what that is and I said it is not a word or words it is just junk.

Member Avatar for ravenous
0
142
Member Avatar for nabeelbhutto

How about you post up some code and then show us exactly where you are having problems. Writing out a big mal-formed paragraph isnt going to make us help you.

Member Avatar for sfuo
0
728
Member Avatar for Epicurus

When I used SDL for graphics I don't ever remember using SDL_GetKeyState(); however, it could have been just a preference that the writer turtorials I followed had. My suggestion (it might not be the best option) is to create your own bool array to manage the key states. You can …

Member Avatar for BeauBeck
0
251
Member Avatar for I_m_rude

> At any point of time, I am asked to return the kth(it is given initally) minimum element from the elements read so far. When I read this I can interperet it three different ways: 1) You are at the 'kth' element and you want to know what the minimum …

Member Avatar for sfuo
0
144