Search:

Type: Posts; User: TactX

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    1,628

    Another way would be to simply return an int*...

    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...
  2. Thread: Random numbers

    by TactX
    Replies
    3
    Views
    1,253

    For more sophisticated random numbers, you should...

    For more sophisticated random numbers, you should have a look at preludes article on using rand().
  3. Replies
    6
    Views
    1,721

    His question is not wrong. The answers (except...

    His question is not wrong. The answers (except from dwks) are.
  4. Thread: Macro confusion

    by TactX
    Replies
    8
    Views
    1,205

    Multiline macros can be done quite well when...

    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 ;)
  5. Replies
    3
    Views
    3,988

    I'd add MS Visual C++ 2005 Express Edition to...

    I'd add MS Visual C++ 2005 Express Edition to that list. It's a nice IDE. Sucks for C99 though (well, MinGW too).
  6. Replies
    24
    Views
    2,138

    And I think you misunterstood what King Mir...

    And I think you misunterstood what King Mir wanted to reach with this bit of code ;)
  7. Thread: fflush(stdin)

    by TactX
    Replies
    23
    Views
    6,620

    gets() does not check for the size of your...

    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:
    ...
  8. Thread: fflush(stdin)

    by TactX
    Replies
    23
    Views
    6,620

    And please, don't use gets(). fgets() is so much...

    And please, don't use gets(). fgets() is so much better.
  9. Replies
    7
    Views
    939

    What's wrong with sscanf()? Edit2: Removed...

    What's wrong with sscanf()?

    Edit2: Removed bullsh...
  10. Replies
    2
    Views
    867

    Based in the assumption that your array is a char...

    Based in the assumption that your array is a char array, i'd using suggest sprintf() or snprintf().
  11. Thread: File names...

    by TactX
    Replies
    12
    Views
    1,280

    You've taken the first example because you use a...

    You've taken the first example because you use a Borland Compiler, right?
  12. Thread: Reverse A String

    by TactX
    Replies
    21
    Views
    2,441

    Where are my special bonus points? :D

    Where are my special bonus points? :D
  13. Thread: Reverse A String

    by TactX
    Replies
    21
    Views
    2,441

    Great :D

    Great :D
  14. Replies
    17
    Views
    6,490

    Storing the key in the Windows Registry is a flaw...

    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.
  15. Replies
    16
    Views
    2,124

    I do not vote for Salem because he shocked me...

    I do not vote for Salem because he shocked me with his "Banned" :)
  16. Replies
    3
    Views
    1,190

    Syntax highlighting only works for stuff like...

    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...
  17. Replies
    6
    Views
    945

    This should explain why it will not work with...

    This should explain why it will not work with strtok().
  18. Replies
    6
    Views
    1,102

    Yes, iostream is purely C++.

    Yes, iostream is purely C++.
  19. Thread: Do you comment?

    by TactX
    Replies
    26
    Views
    1,995

    "Weeks of coding can save you hours of planning."...

    "Weeks of coding can save you hours of planning." :P
  20. Replies
    6
    Views
    1,261

    This link (http://c-faq.com/struct/io.html)...

    This link should make things clear.
  21. Replies
    21
    Views
    2,704

    You could for example mask out the 6 unwanted bit...

    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...
  22. Replies
    21
    Views
    2,704

    You should read the chapter about "bitwise...

    You should read the chapter about "bitwise operators" in your favourite tutorial/book. Especially bitwise AND (&) and bitshift (<< >>) will be important.
  23. Replies
    21
    Views
    2,704

    You could (for example) use an array of strings...

    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...
  24. Replies
    11
    Views
    2,548

    Assuming you're using Linux you should have a...

    Assuming you're using Linux you should have a look at ncurses. I'm sure you will not have problems finding a nice tutorial.
  25. Replies
    7
    Views
    2,356

    I don't get it. You're using MinGW, so you're...

    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...
Results 1 to 25 of 65
Page 1 of 3 1 2 3