There's no implicit conversion here for things like this. How are you expecting a string to be translated to the enum type? You need to parse the input to the enum type if you want this to work.
Type: Posts; User: cstryx
There's no implicit conversion here for things like this. How are you expecting a string to be translated to the enum type? You need to parse the input to the enum type if you want this to work.
CSV = comma separated values
Hint, hint.
Or for a different approach:
int six_bit_sign_extend(unsigned char b) {
b &= 0x3f;
return b & 0x20 ? b | ~0x3f : b;
}
Read the data then use strncmp? If it doesn't match then don't do anything.
Why not just do integer addition?
06/08
(06 * 100) + 08 = 608
Then a format specifier to output 4 digits with leading 0's if necessary. (0608)
edit: Or the reverse I can see is what...
^^ I can get that executable down to about 2k even instead of 4k, but if you are using C++ without the STL then how can it be considered C++? Why didn't you just write the code in C? Sounds like you...
This is what I'm concluding here for myself. 100% agreed.
Okay.. But you are neglecting to consider one critical point here -- The public GUI frameworks that already exist out there for people to use contain absolutely everything to accommodate all...
I posted this topic in the C++ section because it *was* originally about MFC. Additionally, with MFC you get the design view for building windows applications, which makes GUI creation much easier...
Sure, but hard drives aren't the only means of storing portable programs. What if I want to maximize the usage of my USB key with programs to use as tools? I know you can get 1TB USB keys now, but...
I already use .NET for specific projects but why would .NET be a solution for code size? Yes the frameworks exist on the Windows machines, but that means managed code and JIT-compilation unless you...
It's more likely than Qt though to be on the target Windows machine IMO. Also my program is down to ~100kb after some configuration and modification.
Why not though? If I want something smaller in codesize then Qt or any other cross-platform framework is not going to be great, especially when I don't plan for platform scalability. Also, wxWidgets...
I'm curious what the general thoughts are on MFC for C++ GUI (dialog) projects are? Good/Bad? Advantages/Disadvantages?
Is it even recommended for creating GUI applications or would you go with...
Okay, I'm sorry but are you trying to imply that you have more (or lots of) experience with C# just based on your join date to this forum? :S Your join date doesn't say anything about your experience...
The compiler typically will optimize a simple foreach loop to a for loop anyways if you've ever debugged through .NET binaries for such analysis. Therefore, in theory yes, but not really because of...
Significantly slower was a measurement of performance in context with my comparison between simple string manipulation and regex itself, which has nothing to do with human perception. Also, it's not...
They are useful for pattern matching, but the overhead of using regex in this case is going to be significantly slower. It may only be faster if you are using compiled regex on a much larger piece of...
In my opinion, regex is not the best solution anyways and it's also going to be slower than regular string manipulation.
public static bool ValidID(string id)
{
int letters, digits;
int...
Exactly, but null terminated strings vs the usage of std::string -- which should come first? This is what I had in mind when I brought up subjectivity. And where should dynamic allocation come in?...
If C++ didn't exist, are you saying that people would not be capable of learning C in that case because they have to deal with null-terminators? IMO C is actually an easier language than C++ because...
I guess it depends on your perspective. For myself, which is all I can speak for, understanding low level concepts has definitely helped me understand how to effectively use such *features* of the...
It's great that we have pretty much all bases covered now that the issues have been pointed out and laserlight was kind enough to provide further detail about them.
One thing I will add is about...
Fair enough. As far as "string's" go, I was more apt to *guess* that he was going to take the suggestion into consideration without the use of std::string, and I know that many instructors start...
You can't parse a number from userInput because of the 'C' at the front. Try this:
sscanf(userInput + 1, "%d", &number);