Another way would be to simply return an int* from teste(), which would make the function itself rather pointless...
And besides:
- casting mallocs return value is pointless since a void* is...
Type: Posts; User: TactX
Another way would be to simply return an int* from teste(), which would make the function itself rather pointless...
And besides:
- casting mallocs return value is pointless since a void* is...
For more sophisticated random numbers, you should have a look at preludes article on using rand().
His question is not wrong. The answers (except from dwks) are.
Multiline macros can be done quite well when using a do ... while(0) construct. Of course one should use functions an let the compiler decide ;)
I'd add MS Visual C++ 2005 Express Edition to that list. It's a nice IDE. Sucks for C99 though (well, MinGW too).
And I think you misunterstood what King Mir wanted to reach with this bit of code ;)
gets() does not check for the size of your buffer, so if the user writes too much text, you'll have a buffer overflow. You don't have a chance to avoid that when using gets(). The manpage says:
...
And please, don't use gets(). fgets() is so much better.
What's wrong with sscanf()?
Edit2: Removed bullsh...
Based in the assumption that your array is a char array, i'd using suggest sprintf() or snprintf().
You've taken the first example because you use a Borland Compiler, right?
Where are my special bonus points? :D
Great :D
Storing the key in the Windows Registry is a flaw imho. You don't need to a pro hacker to use a tool like regmon or something that gets the difference.
I do not vote for Salem because he shocked me with his "Banned" :)
Syntax highlighting only works for stuff like keywords, #define, strings and such. FILE is a typedef (not a keyword). But that does not explain why the code won't compile (or run). Have you included...
This should explain why it will not work with strtok().
Yes, iostream is purely C++.
"Weeks of coding can save you hours of planning." :P
This link should make things clear.
You could for example mask out the 6 unwanted bit from a by using an appropriate bitmask and then shift the result two bits to the left and use bitwise OR to "add" b to the result.
You could also...
You should read the chapter about "bitwise operators" in your favourite tutorial/book. Especially bitwise AND (&) and bitshift (<< >>) will be important.
You could (for example) use an array of strings and access the strings via array indices (just assign the unused indices an empty string). And do yourself a favour and read a nice tutorial. You'll...
Assuming you're using Linux you should have a look at ncurses. I'm sure you will not have problems finding a nice tutorial.
I don't get it. You're using MinGW, so you're using Windows. What exactly is wrong with SetConsoleCursorPosition()? What is the difference between a "windows console" and a "command line app" under...