Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~6K People Reached
Favorite Tags
c++ x 15
c x 7

14 Posted Topics

Member Avatar for phickman7872

[quote]Does this command exist in C?[/quote] I believe it's fflush(). I could be wrong, though. [quote]And is this the best way to read a line of input?[/quote] If all else fails, I do something similar to this: [code] while ((input = getche()) != '\n' && length <= max_length) { buffer[length] …

Member Avatar for yap.nice
0
401
Member Avatar for bluegirl

You only make something const(constant) if it's , well, constant. If you're going to change anything about it, or any sorts of funky errors pop up, you're better off not const-ing it. I personally never use const, though I did take C first, so that might have something to do …

Member Avatar for Narue
1
214
Member Avatar for Daywalker46410

Left could be done by going: [code] char left(char *string) { return string[0]; } [/code] Right could be done like this: [code] char right(char *string) { return string[strlen(string)]; } [/code] I'm no VB programmer, since it's my personal opinion that VB is for idiots, so I don't know what mid() …

Member Avatar for Narue
0
3K
Member Avatar for josef

Let me get this straight: You want a program that will take a picture, and output a new picture with frames? If so, it should be fairly easy, I think. Just make a bitmap with a little space on each side of the original, and then use the Windows functions …

Member Avatar for josef
1
333
Member Avatar for Mike29936

The other day, I got an idea for a compression program, and decided to write up a function that compresses a file into "filename.compressed". Compression function works fine, but I get a nasty assertion failure at the return of the main() function, after the file's been compressed. Assertion failure is …

Member Avatar for Bob
0
202
Member Avatar for PeteECU

What do you mean 3 users using your program? You're only going to have 1 user to your program, unless it's internet based. If ya' mean 3 different inputs to teh program: [code] #include <stdio.h> #define users 3 int main(void) { printf("Input %d heights:",users); int loop = 0; double temp[users]; …

Member Avatar for Mike29936
0
195
Member Avatar for ShadowBranch

Hmmm.... Well, instead of using DirectX 8.1, you should use DirectX 9. Did you replace the ddraw.h in DirectDraw 4 with the one for DirectDraw 9? I looked at my own DirectX game, and found this: IID_IDirectDraw7 Seeing as how it's case sensitive(or at least that's how my compiler works), …

Member Avatar for Mike29936
0
141
Member Avatar for Mike29936

(edit) Code was too long for forum. I'm splitting it in 1/2 I'm currently working on a Direct3D class that simplifies D3D, so I can use it to make games, applications, etc. I started on it yesterday, got it to work so it draw triangles with a different color on …

Member Avatar for Mike29936
0
257
Member Avatar for Daywalker46410

How bout' something like this: [code] int length(char *string) { int blah = 0; char *pointer = string; while (*pointer++!=NULL) blah++; return blah; } [/code] Theoretically, that should give you the length of a string. Might not work since I thought it up right now. [quote]When I use sizeof(strString) I …

Member Avatar for Mike29936
0
181
Member Avatar for lobo

Awright, I don't know what 'cs' is. But here's a basic idea of what you need to do: Get input and store in variables named 'width' and 'height' for (temp=0;temp<width;temp++) for (temp2=0;temp2<height;temp2++) print out '#' How it works is it goes across: ##### But since theres another for loop every …

Member Avatar for lobo
0
160
Member Avatar for camelNotation

Well, if you want, I could cook up a console game, and you could learn from that.

Member Avatar for Mike29936
1
159
Member Avatar for Raineri33

From my understanding of your post, it sounds like you want to get a 2D array of seats, add passengers, and sort em'. A 2D array will be done something like this: [code] bool **array = new bool*[width]; for (int temp=0;temp<width;temp++) array[temp] = new bool[height]; [/code] Thus, you have an …

Member Avatar for Mike29936
0
450
Member Avatar for rymade

Your first program is too big. Something like: [code] #include <stdio.h> void Swap(int *first,int *second) { *first ^= second; *second ^= first; *first ^= second; } int main(void) { int numbers[4]; for (int temp = 0;temp<3;temp++) scanf("%d",&numbers[temp]); for (temp=0;temp<2;temp++) { if (numbers[temp] > numbers[temp+1] ) Swap(&numbers[temp],&numbers[temp+1]); } if (numbers[0] > …

Member Avatar for Armeggadon
0
252
Member Avatar for blackspyder01

Do you know the position of the char? If so: char_array_name[position] = new_character; char_array_name is the name of the array. position is an integer value specifying the offset from the address of the start of the array. new_character is the character you want it to replace it with, like 'A'. …

Member Avatar for Mike29936
0
193

The End.