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

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

    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
    23,253

    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
    23,253

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

    *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
    1,082

    Glad it helped. :)

    Glad it helped. :)
  10. Replies
    15
    Views
    3,126

    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
    935

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

    This will compile... #include ...

    This will compile...


    #include <stdio.h>

    struct myfile {
    FILE *myPtr;
    };

    int main( int argc, char **argv )
  13. Replies
    15
    Views
    3,126

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

    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
    10,338

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

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

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

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

    Any luck, Susu? Kevin

    Any luck, Susu?

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

    by kmess
    Replies
    34
    Views
    8,177

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

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

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

    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