Hi all,
I want to create a pointer to a C-String like so:
char *pCString = "This is a string";
and then delete the memory reserved for the C-String:
Type: Posts; User: dhardin
Hi all,
I want to create a pointer to a C-String like so:
char *pCString = "This is a string";
and then delete the memory reserved for the C-String:
Almost fixed it. I figured that since I'm trying to use C-Strings, that adding the termination character '\0' at the end of final[] would help (and it did!). Now I have a couple of strange...
Hi all,
I've been writing a program to add two character arrays, which both hold a binary number and using binary arithmetic, stores the final value in another character array.
So far, i've...
Alright, well I'm no longer getting the vector out of bounds error. I found my new issue to be my lack of knowledge in directX. My initial problem was that the pink in the above image was...
O.K. i'm confused by my own code. So i'm gonna think out loud to you guys.
The minX, maxX, minY, and maxY values are supposed to be the coordinates within the whole game where the collision is...
what function?
@tabstop
yep, i'm using the vector as a sort of 2D array (I don't know how to allocate memory for the 2D so I used a vector instead). Yeah, my product is probably wrong as well...VERY TIRED X[
...
Hey everyone,
I've been coding a collision detection function for about 12 hours now using DarkGDK, DirectX, and C++.
My 2D game detects the function call. I know this because the frame rate...
Thanks, my eyes are getting tired though and I should probably wait till morning before I can think clearly :\
But thanks for all your help, I'm still confused on all the different examples I've...
yeah, i figured i'd need some kind of loop like that. I was gonna write mine from scratch and store the mask for the sprite in a 2d array. Then somehow, get the detection to work from there...but I...
cool, thanks!
Looking through the code now....i've never used allegro but I might be able to convert over to directx. I have seen other examples and they were quite different.
see here
p.s....
Hey everyone,
I am currently implementing the darkGDK library for creating a basic 2D game.
USING:
Microsoft Visual C++ 2008 Express
DirectX SDK 2009 (August)
DarkGDK
I actually can't...
#include <iostream>
using namespace std;
try adding that at top of code.
also, are you giving us the full program? (just wanted to make sure you were including the right header files and...
okay, that seems pretty self explanatory. The book did not provide these files on a cd and I was trying to duplicate a file that the book used...considering that they said thats what the file looked...
Never mind, I got it.
In the text file Accounts.txt, the format should have been this:
Chester, 12345 56.60\n
The comma between the account number and balance should have not been there. I...
In the code provided below, I have written a program (word for word) from my text book. This program reads the text from a file named Accounts.txt and parses the string input to a different format...
Well, I took out the references to the returned values of functions and just passed the values as references into my tellStory function. AND IT WORKS!!! So thank you! I will have to read into it a...
Okay, so it was the scoping issue....but the book exercise does require me to use references somewhere....
I know I have to use them in the tellStory parameters, but wouldn't I have to pass...
So instead of having my functions return a reference, I can just return a value? But what about my original initialization of the variables name, noun, number, bodypart, and verb? I have tried to...
I am going through my C++ book and one of the exercises asks you to alter an earlier project using references (to make it more efficient). I have written the program (see below), but when I run the...
Alright, so far I have used pelicanpie's method of checking for a winner (using a separate function call). On top of that, I fixed my rowSelect and columnSelect variables so that when a user enters...
okay, thanks a lot for all who replied! I will be taking a look at my code and try to add in your advice (stuff that I understand more of course). Will post my code when i'm done.
thanks again!
well, I did more searching...and it looks like everyone I looked at (which I gave up quickly) used a series of if statements. Not that I do not like using them, its just that I was hoping for a...
i'm creating a tic tac toe game (no functions unfortunately.....sorry!) and was trying to check for a winner at the end of each turn. Is there any way of doing this without using a hefty amount of...
okay, that will help a lot. thanks!