Search:

Type: Posts; User: TactX

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    5,472

    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,986

    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,924

    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,530

    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
    4,439

    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,798

    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
    8,023

    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
    8,023

    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
    1,240

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

    What's wrong with sscanf()?

    Edit2: Removed bullsh...
  10. Replies
    2
    Views
    1,065

    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,845

    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
    3,593

    Where are my special bonus points? :D

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

    by TactX
    Replies
    21
    Views
    3,593

    Great :D

    Great :D
  14. Replies
    17
    Views
    9,632

    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
    4,444

    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,657

    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
    1,309

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

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

    Yes, iostream is purely C++.

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

    by TactX
    Replies
    26
    Views
    4,685

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

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

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

    This link should make things clear.
  21. Replies
    21
    Views
    4,701

    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
    4,701

    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
    4,701

    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
    3,273

    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
    3,852

    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