Basically, I'm trying to create a password dialog in C++ for window. This may seem like a lot to ask, but I'm a total noob when it comes to windows programming other than a simple window with a...
Type: Posts; User: Ganoosh
Basically, I'm trying to create a password dialog in C++ for window. This may seem like a lot to ask, but I'm a total noob when it comes to windows programming other than a simple window with a...
But wouldn't just just delete ptr1 because it's also a pointer? Or does the compiler know to delete ptr2 because ptr1 wasn't allocated with new?
I haven't coded in a while, months. Anyway I'm back and I need a little refresher.
If I have 2 pointers:
Type* ptr1;
Type* ptr2;
and set ptr2 using new, and set ptr1 to point to ptr2, how do...
I'm sure there's got to be a way to do this. Is there some way to trick the compiler into allowing a redefinition of an enum. For example say you have:
enum type {};
and then you want to define...
Which would be faster and more efficient, using an initializer list, or setting variables the traditional way (this->x = x or memberX = paramX etc)?
Hmm.. so would I put:
extern Window* gwindow;
extern Settings* gsettings;
at the beginning of each file I include the header? It still does the same thing.
In a program I'm working on, I have a header file which defines some structs. In that same header file I have 2 pointers:
Window* gwindow; // global pointer to core Window obj
Settings*...
Yeah I'm avoiding windows dependencies because i wanna make a whole image loader to support multiple filetypes that I'm also gonna use on linux. Anyway, I'll try that and see what happens, thanks.
You mean like using the clipboard?
template <class obj_type> class LinkedList {
struct LLNode {
obj_type value;
LLNode* next;
};
public:
LinkedList();
~LinkedList();
...
I made a nice little linked list class a while ago if you want the code I can post it for you. It uses structs and a class, and also templates if you don't understand them yet maybe I should off,...
I'm having trouble with this one, as easy as the format is, I'm doing something wrong. I have a function here to load a bmp file, taking the filename:
LIMAGE BMPLoader::loadBMP(const char*...
Yes it is actually, but I copied the same code to the main cpp and it worked perfectly fine. For some reason the folders just mess it up or something. But I'm gonna try putting it in a...
Sorry for the late reply, been busy and haven't had time to check this. Here's the function, LIMAGE is a struct that contains width, height, type and a char* to hold image data.
LIMAGE...
I'm having a problem opening a file and I'm thinking it's because of directories or something. I'm working on an image loader and i have a file test.bmp, but whenever I call the function, it fails...
The STL, all kinds of little additions, I think new and delete are new to C++ or do they work in C?
char temp[arg.length()];
strcpy(temp, arg.c_str());
strcpy(settings->profile.name, temp);
If I try to copy temp into settings->profile.name, Windows gives me the old, this program has caused an...
Ok, the problem is I have a char* and in a function I set it to a variable. That variable only lasts as long as the function does. The problem is it's a char* so it points to the address of the...
Wow this is greate information, helping a lot, I'm finding places where I can optimize using strings now, though still some are char*s. I prefer using a char* except when I gotta do a lot of...
Assigning it to a non-const char*, which most of mine are.
Only problem is that c_str() returns a const
Ah, thanks guys I've been hassling over this for hours.
Nope, I'm using char*s. I do like the ease of string better, but nothing really uses strings, so I just keep it char*s.
Is there an easy way to take out certain characters in a string, or do I have to do the old way and implement a for loop that removes all occurences of it?
What would be the best way to get input for a game on windows? Besides DirectInput.
Nice, that'll help thanks guys