Search:

Type: Posts; User: kmess

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Is the file to be text or binary? If it's a...

    Is the file to be text or binary? If it's a binary file, use fwrite...

    Cprogramming.com - Tutorials - C File I/O

    Kevin
  2. fclose needs to be passed the FILE, not a string,...

    fclose needs to be passed the FILE, not a string, e.g.

    fclose(infile);
    Kevin
  3. Replies
    3
    Views
    881

    Can you please post your program that is causing...

    Can you please post your program that is causing this error message? It looks like you're using cygwin on Windows. Is this correct?

    Kevin
  4. Replies
    3
    Views
    4,686

    You can find the size of the array and divide it...

    You can find the size of the array and divide it by the size of a char pointer:



    #include <stdio.h>

    int main( void )
    {
    char *valid_help_str[] = {
    "help",
  5. Any time :)

    Any time :)
  6. Replies
    9
    Views
    17,782

    Indeed, but my comment focused solely on the...

    Indeed, but my comment focused solely on the conditional test expression and the elimination of the break statement proposed earlier, not on the program as a whole.

    Kevin
  7. Replies
    9
    Views
    17,782

    A more straightforward solution that avoids the...

    A more straightforward solution that avoids the use of the break statement is to to alter the while statement's conditional test:


    i = 0;

    while ( i < 10 ) {
    scanf( "%i",...
  8. Replies
    7
    Views
    905

    *blush* - I caught it, but evidently not fast...

    *blush* - I caught it, but evidently not fast enough! I was editing it the same time you were writing about it! :tongue:

    Kevin
  9. Replies
    7
    Views
    905

    Glad it helped. :)

    Glad it helped. :)
  10. Replies
    15
    Views
    2,532

    That's probably why I'm finding it in my library...

    That's probably why I'm finding it in my library - I use BSD. Cool to know.

    Kevin
  11. Thread: Access Violation

    by kmess
    Replies
    1
    Views
    700

    Just a few things to get this code to compile: ...

    Just a few things to get this code to compile:

    The main function by definition must return an int. You have defined your function as void, and you fail to return anything at the end of the...
  12. Replies
    7
    Views
    905

    This will compile... #include ...

    This will compile...


    #include <stdio.h>

    struct myfile {
    FILE *myPtr;
    };

    int main( int argc, char **argv )
  13. Replies
    15
    Views
    2,532

    HI Grumpy. I think that bzero() is part of the...

    HI Grumpy. I think that bzero() is part of the C99 standard library. It just isn't available in ANSI C. Can anyone confirm?

    Kevin
  14. Replies
    15
    Views
    2,532

    You didn't mention if you want to initialize the...

    You didn't mention if you want to initialize the arrays several times during program execution, or whether you want to have the arrays initialized one time at the beginning of program execution.
    ...
  15. Thread: need of fclose()

    by kmess
    Replies
    4
    Views
    5,420

    fclose() closes the associated file. If function...

    fclose() closes the associated file. If function fclose() is not called explicitly, the operating system normally will close the file when program execution terminates. However, if the file is being...
  16. Hi. Since I don't have your configuration, I...

    Hi. Since I don't have your configuration, I can't test anything.

    Can you print anything to the LCD? For example, can you send the characters in "Hello" and have it display properly?

    Second,...
  17. Replies
    1
    Views
    1,176

    The expression you're referring to is in what's...

    The expression you're referring to is in what's called "infix" notation, and you will need to convert it to "postfix" notation to evaluate it properly.

    Check out InFix to PostFix and PostFix...
  18. Replies
    10
    Views
    1,096

    I guess we have different motivations in helping...

    I guess we have different motivations in helping people. For instance, I like to see that people are making progress toward solving their problems. What's your motivation?

    Kevin
  19. Replies
    2
    Views
    1,000

    Hi intimidator. You are on the right track in...

    Hi intimidator. You are on the right track in that you need to ask the user to input some values. You just need a bit of refinement to get this to first compile, and then to function as you'd like. ...
  20. Replies
    10
    Views
    1,096

    Any luck, Susu? Kevin

    Any luck, Susu?

    Kevin
  21. Thread: Guess What...??

    by kmess
    Replies
    34
    Views
    4,260

    Oops, sorry, missed your second question... scanf...

    Oops, sorry, missed your second question... scanf will read all non-whitespace characters and store them into a C string whose address you've passed as an argument. I'm thinking that instead of
    ...
  22. Thread: Guess What...??

    by kmess
    Replies
    34
    Views
    4,260

    Your "guess" array is an array of char, into...

    Your "guess" array is an array of char, into which you're storing an integer value 0 or 1 at element 15. You then attempt to use a switch statement on the characters '0' or '1' (which have ASCII...
  23. Replies
    3
    Views
    1,451

    While it doesn't answer your primary question,...

    While it doesn't answer your primary question, I'm seeing two different serverFunction()s. The first is the prototype,

    static void serverFunction(void *t);
    and the second is the definition:
    ...
  24. Replies
    10
    Views
    1,096

    It's not surprising you can't find any problems...

    It's not surprising you can't find any problems in your code - you have absolutely no structure! The compiler doesn't care how your code is formatted, but other programmers do. You'll find you'll...
  25. Sorry, you'll need to get someone who works with...

    Sorry, you'll need to get someone who works with Windows to help you beyond this stage. I'm a *nix guy...

    Good luck!

    Kevin
Results 1 to 25 of 66
Page 1 of 3 1 2 3