Search:

Type: Posts; User: zx-1

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    16
    Views
    4,886

    Given the fallout when some of those teachers...

    Given the fallout when some of those teachers post on this very forum, it's fair to wonder.
  2. "It occurs in C as well so it's moot?" Isn't C++...

    "It occurs in C as well so it's moot?" Isn't C++ is supposed to be an improvement over C? Surely there was a point to duplicating the C library functionality beyond keeping the status quo. I'm sure...
  3. Sure, but it works pretty sloppily. Try...

    Sure, but it works pretty sloppily.


    Try getting a line of input from cin. As we all know from C, scanf() is error-prone and we should be getting whole lines with fgets() and parsing that. So...
  4. Replies
    16
    Views
    4,886

    In C, ^ is bitwise XOR. You indeed need pow(). ...

    In C, ^ is bitwise XOR. You indeed need pow().

    Furthermore, you aren't faithfully representing the summation; there are two errors. Try using a debugger to step through each line while watching...
  5. I'd want to use it because iostream provides no...

    Indeed. I have to second this notion.[/QUOTE]

    I'd want to use it because iostream provides no genuine advantages over stdio, and several disadvantages.
  6. Replies
    9
    Views
    2,332

    Because that's just the way the language is...

    Because that's just the way the language is designed.

    C can have arrays like that, mind you.
  7. We actually have a board for game programming. ...

    We actually have a board for game programming.

    I didn't read the code, but the smart-alecky summary would pretty much go like:


    "Singleton Considered Harmful etc. etc.".


    "Premature...
  8. In this instance it would be vastly more readable...

    In this instance it would be vastly more readable to say return s != 1000;.
  9. Thread: Data Types

    by zx-1
    Replies
    7
    Views
    1,292

    When you do the a-b, a is promoted to unsigned...

    When you do the a-b, a is promoted to unsigned int, and so the expression result of -1 overflows to INT_MAX. Your platform has 32-bit ints, so this is 4,294,967,296. Assigned to a float, this...
  10. Thread: Goodbye everyone

    by zx-1
    Replies
    8
    Views
    3,346

    And nothing of value was lost.

    And nothing of value was lost.
  11. Thread: Prolog

    by zx-1
    Replies
    4
    Views
    2,446

    There's actually one for Windows: Visual Prolog...

    There's actually one for Windows: Visual Prolog.

    And of course you can always fall back on Vim and Emacs plugins.
  12. Replies
    13
    Views
    2,872

    Find-String(T,P) 1 n ← length(T) 2 m ←...

    Find-String(T,P)
    1 n ← length(T)
    2 m ← length(P)
    3 for s ← 0 to n - m
    4 do if P(1 .. m) = T(s + 1 .. s + m)
    5 then print “Substring found with shift” s


    This pseudocode which I...
  13. Replies
    8
    Views
    2,309

    You can use strtok() to chop up the data,...

    You can use strtok() to chop up the data, especially if your delimiters are no more complicated that a single comma.

    If your C library is POSIX, you can use regex.h functions to parse it (but then...
  14. Replies
    5
    Views
    2,352

    You are assigning 'false' to 'search' in the...

    You are assigning 'false' to 'search' in the while loop, not testing for equality.
    In the future, turn up compiler warnings.
  15. Replies
    14
    Views
    1,965

    Some style notes: Pupils and students are the...

    Some style notes:

    Pupils and students are the same thing.

    It's rather redundant to qualify a drop-down menu with "choose only one of the following".

    "Qt" is a GUI toolkit made by Nokia. "QT"...
  16. Thread: Back from Vista

    by zx-1
    Replies
    28
    Views
    5,567

    The straight answer is no, he means upgrade his...

    The straight answer is no, he means upgrade his hardware to PCIe or something.
  17. It is where I'm sitting, at least: $ c++...

    It is where I'm sitting, at least:


    $ c++ try.cc
    try.cc: In function `int main()':
    try.cc:9: error: invalid conversion from `int' to `main()::enum_t'


    It's not an error in C. Maybe that's...
  18. Because he doesn't want an enum, which restrict...

    Because he doesn't want an enum, which restrict what you can assign to a variable to a number of identifiers, but something that can be assigned to at will, just not anything other that 0 to 4....
  19. Your development suite doesn't support ISO...

    Your development suite doesn't support ISO standardized functions. So god only knows what else it's deficient in.


    Probably a good idea to get a better development environment.
  20. Replies
    17
    Views
    3,077

    The implication of using fflush() on the stdin...

    The implication of using fflush() on the stdin stream.
  21. Replies
    10
    Views
    4,318

    There's PyQt...

    There's PyQt and a fine book on it.
  22. Replies
    17
    Views
    3,077

    -------------------------------- lulz.

    --------------------------------


    lulz.
  23. Replies
    3
    Views
    1,353

    Yes. The latter is a C++ header file for...

    Yes.

    The latter is a C++ header file for accessing the functions in the mathematics library.

    The former does not exist.
  24. Replies
    10
    Views
    2,333

    For what it's worth, it is in BSD and OS X. ...

    For what it's worth, it is in BSD and OS X.

    And at any rate, strtod is the better function.

    (Also, gets is still supported by the C standards, so that's really a suboptimal argument to make.)
  25. Replies
    10
    Views
    2,333

    You need to #include . And #include...

    You need to #include <stdlib.h>. And #include <stdio.h> while you're at it. (Why you need to be told this, I don't know...)

    And also, atof is deprecated in favor of strtod. Replace with...
Results 1 to 25 of 160
Page 1 of 7 1 2 3 4