What terminal are you using? Mintty or something else?
This might be relevant: ncurses on windows, can't receive KEY_MOUSE
Type: Posts; User: christop
What terminal are you using? Mintty or something else?
This might be relevant: ncurses on windows, can't receive KEY_MOUSE
The short answer is that it creates a window and then processes messages sent to it. This is a basic skeleton of a Windows application.
A "message" is something that Windows sends to a window (or...
When you do str[0] - '0', I believe the result is automatically promoted to an int, and when you send that int value to cout it's converted to its text representation, so you'll see "1", "0", and "3"...
Spaces in a file name need to be escaped or quoted when used in a shell. Do you consider spaces to be "unsafe"? Are spaces "special"?
Why would my age matter? I've been putting spaces in file...
OK, but I still don't understand what you mean by "safe". All characters that you might find in a file name are "safe" (otherwise the OS wouldn't have let you use them in a file name in the first...
Are you renaming the files themselves, or just displaying their names in some sort of user interface? If the former, I'd be careful not to overwrite existing files. For example, if you have two files...
I'm pretty sure delete this in a class's destructor will cause problems. What happens if an instance of the class was statically or automatically allocated? You can't delete it. And if it's...
But strspn returns 1 only when the first character is special and the next character is not special. So strspn("##foo", SPECIAL_CHARS) will return 2.
strspn and strcspn are the wrong tools for...
But that requires that you assume how sem_t is defined. POSIX doesn't say how the sem_t structure is defined. A semaphore with a value of 0 might be valid. On the other hand, a null pointer to a...
typedef sem_t *npawsem;
#define INVALID SEM NULL
Then make a function to allocate (with malloc() or shmget() or shm_open() or whatever, depending on how it's shared) and initialize (with...
In other words, the compiler you used (GCC?) is smart enough to optimize the recursive code to the equivalent to this code:
int divide(int a)
{
if (a > 1) {
return 1;
}
...
Tail call optimization isn't a guaranteed feature of C. Many compilers can do it, but you can't count on it in general.
To be clear, (++x)*(++x) is undefined behavior because you cannot modify the same object more than once between sequence points. You can't and shouldn't expect any particular result from undefined...
Interesting, and I stand corrected.
But it seems the C standard implies that char is always one byte, whether it's 8 bits or 16 bits or 32 bits, since the size of every type is measured against...
One nitpick: sizeof reports the size of an object or type in terms of the size of a char, not bytes. A char is one byte on most platforms, but some platforms may define char as 16 or 32 bits (in...
I disagree for the most part.
A beginner programmer shouldn't really worry about how big each data type is (they should understand their ranges and when and where to use each type, though). And by...
Yeah, that has always irked me. But to be fair to the original stdio designers, they created it long before the convention existed to put the object parameter first.
"toupper" (note the "u") is in ctype.h, but strchr is in string.h.
Since you aren't worried about exactly following C++ method-calling syntax, why not just call the methods directly without a "method_call" macro?
So instead of this:
method_call...
What you should do instead of hardcoding the size of int as 4 (int is larger or smaller than 4 on some platforms) is to use sizeof (int), or better yet, sizeof array[0]:
unsigned int size...
Doesn't answer the question of how namespaces are flawed. Your insistence on using a class where a namespace is more appropriate, however, has already been addressed by an answer to a Stack Overflow...
Packages in Java and the namespace keyword in C++ both implement the "idea" of namespaces, which you implied is flawed:
Or do you mean something else?
If you only mean that "namespace" in...
???
I'm thinking there might be a language barrier here. "Judgment", as laserlight used the word, means (from a quick Google search on its definition) "the ability to make considered decisions or...
Yes (if and only if the object is no longer needed). Who said otherwise?
C# isn't really relevant here, though. This thread seems to be about the ol' Win32 UI API in C++.
Clearly you could care less as you do care at least a little about them. (If you cared not a whit about them then that means you couldn't care less about them, and you wouldn't be posting about them...