Let's say I have a function that takes a reference to a string, is it safe to pass a c style string to this function? Or should I use a local copy so the constructor does it's job? I tested this and...
Type: Posts; User: Kirdra
Let's say I have a function that takes a reference to a string, is it safe to pass a c style string to this function? Or should I use a local copy so the constructor does it's job? I tested this and...
Thanks for the quick response, that's what i was looking for.
How can the name of an object of a class be used as an expression, like what would I need to do in the class definition? I'm thinking something along the lines of how std::cin can be used to check if...
Thank you adeyblue, that looks very helpful :)
I know how I can use WM_KEYDOWN and WM_KEYUP to emulate keypresses or keyboard_event but this only seems to work for virtual key codes. How do I emulate character keys like '@'.
Thanks.
Sorry to bother you :)
I got a .bin im using as a custom resource file where I am storing 1 byte to save the state of a menu item, I don't want external files.
Here is what I tried and it...
I think I found my answer, dunno till I try it out, FindWindowEx is used for this purpose I am reading. FindWindow doesn.t work to get the child control handles.
I'm trying to make a little program that will fill out my account information on another program, because I can't be bothered to type it out every time. :)
So here is what I am trying to do, get...
I want to get the pixels from the entire screen not just a window.
edit:
I've discoverd that if i check the same spot hundreds of times sometimes it will show the color, so i guess it must have...
I need to find the color of any/all pixel/s on the screen. The code I got so far seems to do that but it doesn't get the pixel of my game window (another program, direct draw window app).
Here is...
yea that works, thanks.
if(keydown(VK_NUMPAD4))
{
while(keydown(VK_NUMPAD4))
Sleep(1);
cout << "set scroll number: ";
cin >> scroll_num;
return;
}
I learned C++ first, but reviewing K&R TCPL was worthwhile.
string str = "Percentage ";
str += percent;
namespaces are useful if you make a function library. Their purpose is to reduce name clashes. Also it helps a human reader understand what a function or variable is for if they are grouped together...
I have brought you a fountain for your game... I would also give your characters some kind of location variables (i.e x,y).
cout << "You arrive at the fountain of forgiveness..." << endl;...
I had this problem using DirectInput, when I played my game on another computer it worked.
That class is the equivalent of using plain functions, if you only need one instance of data you don't need to put it in a class; you can just use plain data and functions. However a monster is the...
He didn't ask for reasons not to use it, yes, goto is shunned but it has its uses, particularly for optimisations.
The data is best kept private so you can explictly control how objects are used. The public section provides the interface to the user. Also if there is an error causing a member to take an illegal...
I just use an integer to represent a tile; if it is above a certain number it is walkable, if not it is non walkble.
Saving and loading is quite simple, though you'll have to read a tutorial or...
Turbo C++ runs in fullscreen :)
add the scope operator to string... std::string.
I think you need to use integer type data (int/char) to iterate through loops.
I did a test at drawing bitmaps, with DirectDraw I could draw over 1,000,000 32*32 bitmaps each loop(with considerable slowdown). The same test with the D3D9 caused the computer to crash, I then...