Search:

Type: Posts; User: vyn

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    838

    Defining aray constants

    Is it possible to do the following in C:



    #define BLACK {0, 0, 0}
    #define RED {255, 0, 0}
    #define GREEN {0, 255, 0}
    .....

    int colour[] = BLACK;
  2. Replies
    9
    Views
    1,639

    [Newbie]How to implement type inheritance?

    An Animal can be a Dog, Fish, Bird, etc

    A Dog can be a Shepherd, Terrier, etc
    A Fish can be a Guppy, Salmon, etc


    getAnimal(InputStream) reads some input from the input stream and returns an...
  3. What does the following syntax mean (function declared inside a function)

    char ** parse(char *line) {
    char *newstr();
    .
    .
    .
    .
    }

    char *newstr(char *s, int l) {
    .
  4. Replies
    7
    Views
    9,594

    Thanks, this explained it well.

    Thanks, this explained it well.
  5. Replies
    7
    Views
    9,594

    I want to input to end immediately on EOF. ...

    I want to input to end immediately on EOF.
    Meaning when I press Ctrl-D after input, it immediately terminates and prints EOF detected. Try pressing Ctrl-D immediately after typing your input.
    It...
  6. Replies
    7
    Views
    9,594

    Terminating input on EOF

    I wish to read input from standard input until EOF is detected:



    #include <stdio.h>

    #define MAX 127

    int main()
    {
  7. Replies
    4
    Views
    8,458

    I have the same question: how do I prevent the...

    I have the same question: how do I prevent the above from happening? I want the input to terminate on pressing Ctrl-D/Z. The behaviour should be like the following:



    The Unix cat program seems...
Results 1 to 7 of 7