Search:

Type: Posts; User: Lord Thunder

Search: Search took 0.01 seconds.

  1. Thread: char

    by Lord Thunder
    Replies
    17
    Views
    2,833

    Not really, apart from allowing you to find...

    Not really, apart from allowing you to find 'binary' keys too.

    I tried to write a routine that shows you how it would work. memcmp() works fine too. I was under the impression I could make it a...
  2. Thread: char

    by Lord Thunder
    Replies
    17
    Views
    2,833

    You're welcome ;) I think quzah explained the...

    You're welcome ;)

    I think quzah explained the ASCII vs binary bit quite okay. As for your routine: it will work, but please note that strlen() also assumes a ASCIIZ string and will give you the...
  3. Replies
    11
    Views
    4,229

    If you cared to read the initial post, it says...

    If you cared to read the initial post, it says his assignment requires him to compile with -ansi, which means his teacher wants them to write ANSI-C code only, not C99.

    LT
  4. Replies
    3
    Views
    2,404

    No, the variable space is allocated only once the...

    No, the variable space is allocated only once the before/at the start of the loop, the only difference is that any variable you may declare inside a block, cannot be used outside of the block.

    In...
  5. Replies
    3
    Views
    918

    I would use a switch statement in teh function...

    I would use a switch statement in teh function instead of a battery of else-if constructs.

    Actually, a common solution to this is not to make a function at all, but a constant map. It's faster,...
  6. Replies
    11
    Views
    4,229

    This is true, but then you also have to remember...

    This is true, but then you also have to remember that you are not allowed to use that variable anywhere outside that block. (I cannot think of a sane piece of code where that would be a problem, but...
  7. Replies
    11
    Views
    4,229

    { printf("Please enter the filename for the...

    {
    printf("Please enter the filename for the text file to process, or enter -h for help. Press Enter to exit: ");
    fgets( inputBuffer, sizeof(inputBuffer), stdin);
    char *newline =...
  8. Replies
    43
    Views
    3,507

    I have read (some of) Wirth's books, he likes to...

    I have read (some of) Wirth's books, he likes to use simplified versions of IBM's PL/1 and (in his later books) Oberon, which he created. Both look similar to Pascal at a glance.

    Offtopic: His...
  9. Replies
    43
    Views
    3,507

    There .. fixed. You don't even have a compiler,...

    There .. fixed.
    You don't even have a compiler, do you?

    LT
  10. Replies
    10
    Views
    1,762

    Why bother with short source code? Your compiler...

    Why bother with short source code? Your compiler will just give you a hard time (spamming warnings) and then (hopefully) compile it to the same machine code anyway. What you should really be looking...
  11. Thread: char

    by Lord Thunder
    Replies
    17
    Views
    2,833

    I think the problem has little to do with the...

    I think the problem has little to do with the type of the array. I think your code should work.

    The problem lies with your use of strstr(). The strstr() function expects a so-called ASCIIZ string....
  12. Replies
    8
    Views
    40,745

    Sorry if I am a topic digging here, but I came...

    Sorry if I am a topic digging here, but I came across this thread while searching for the answer for exactly this problem and I noticed noone here gave the right answer.

    The answer turned out...
Results 1 to 12 of 12