I figured it out.
Apparently Allegro likes to take over the main() function, so it got confused when it didn't see one. I added
#define ALLEGRO_NO_MAGIC_MAIN
to the top of the main...
Type: Posts; User: screennameless
I figured it out.
Apparently Allegro likes to take over the main() function, so it got confused when it didn't see one. I added
#define ALLEGRO_NO_MAGIC_MAIN
to the top of the main...
I moved all the source files out of the old solution/project and created a new empty DLL project, imported the sources, and linked the Allegro library again. Still got the same error.
Just tried...
Update:
I found a setting that marks /NOENTRY, selected it, and tried to recompile with no success. Same error.
I'm trying to create a DLL within Visual C++. The classes all used to be part of a "test program" with a main.cpp but now I am trying to move them to their own DLL and then have main.cpp reference...
I've been working with socket programming lately; and I'm currently making a server that listens on a port for incoming connections, then once it gets one, reads in a string and places it in a file....
Thread moved here.
Ohh, haha, I didn't think of changing the compare() function. Thanks!
Hmm. Well, the only way I can imagine using this is as a replacement to push_back(), by using resize() and then at() to assign it.
Is this what you had in mind?
Ahh, I see. Well, thank you then, I will do this. :)
Memory management is not really my forté, I'm still a beginner!
Hmm, does this provide any advantages?
Thanks everyone. I've decided against using at() because it's a passive parser. It shouldn't throw an exception if it doesn't equal something, it should only move on to the next combination of chunks...
If you mean vector::size, then thank you! I'm not quite sure how I missed that. :D
I'm writing a parser that gets a line from a file and separates it (by spaces) into a string vector. Unfortunately there's no way to know how long the string will be. And to figure out what the...
Alright, alright. Thank you everyone. I won't allocate on the heap. I was simply trying to ensure that I am not, for example, allocating a string on the stack until it gets long, and then having it...
Ah, thank you for pointing that out. The loop used to be a while() loop.
So, you're saying that strings are on the heap most of the time anyway?
I understand that they grow in the stack. But "line" has the potential to be very long. I don't want it to be the cause, or to help cause a stack overflow in the future.
Because I'm sticking to...
I dynamically allocated string "line" because I don't know how large it will get to be.
I can assign data to line just fine, however, when I try to scan for spaces in the string, it causes a...
Okay. The function now is able to read a line from config, and return it to the caller.
The problem now, is that it always returns the first line of configuration.
The config file looks like...
Okay. So I have the function set to realloc "value" to the size of the string to be returned.
Back to main; if I declare the pointer as:
char *blah = getconf(false,"test");
will it...
Now, when you say prompting for the size of the input, does that mean I can wait and allocate based on how big the final variable needs to be?
For example, getconf gets a setting which equals...
Thanks for your reply!
Would my pointers have to point to a char array? Or should I use malloc()?
These things always confuse me, no matter how many tutorials I read...
I see. But why does
char *blah;
work in main?
I'm sort of a self-taught beginner programmer here. One thing I always tried to avoid was pointers. After this last project, I figured I had to start learning them, as well as improving what other...