Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.12 seconds.

  1. Replies
    5
    Views
    80

    No, it works for the entire array: struct s_rf...

    No, it works for the entire array:

    struct s_rf s_radioMssg = {{'F', '1', '2', '3', '4', '5', '6', '7', '8', '9'}, T};


    It doesn't: your array does not store a null terminated string.


    Use...
  2. Replies
    5
    Views
    80

    Is s_radioMssg really supposed to be a global...

    Is s_radioMssg really supposed to be a global variable, i.e., does it represent truly global state?

    If not, then I suggest that in your header:

    struct s_rf {
    char command[10];
    boolean...
  3. Replies
    5
    Views
    80

    The problem you're having is this: the member...

    The problem you're having is this: the member named command is an array, and you cannot assign to an array because it is not "a modifiable lvalue". You can assign to the elements of this array...
  4. Replies
    4
    Views
    191

    I suggest that you break down the problem into...

    I suggest that you break down the problem into parts, each of which corresponds to a function. For example:

    /* Returns the number of consonants in the string: */
    int count_consonants(const char...
  5. fopen returns a FILE*, not an int: the int is...

    fopen returns a FILE*, not an int: the int is because the result of fopen("foo","r") == NULL is an int. That warning message is exactly what Salem was talking about.
  6. Replies
    4
    Views
    234

    Is this supposed to be an array of string...

    Is this supposed to be an array of string constants? If so, then the best solution would be to define them inline in a header file:

    inline const char strings[][64] = {
    "One",
    "Two",
    ...
  7. What is your current code?

    What is your current code?
  8. Replies
    10
    Views
    140

    Yes, but you don't need the extern for function...

    Yes, but you don't need the extern for function declarations as they have external linkage by default.
  9. Replies
    10
    Views
    140

    It doesn't really matter where you put it in the...

    It doesn't really matter where you put it in the source file, so long as it is only one source file (so they are only defined once) and at file scope (so that they match the forward declarations).
  10. Replies
    10
    Views
    140

    The problem is that these are defined in the...

    The problem is that these are defined in the header:

    const unsigned int Customer_ID = 0xa316;
    const unsigned int CRC_Init = 0xFFFF;
    You would need to move them to a source file, replacing them...
  11. They are equally efficient and would probably...

    They are equally efficient and would probably compile to the same assembly code. In terms of style, I would recommend:

    void birthday(person *p) {
    p->age++;
    }
    Since birthday is defined...
  12. Replies
    7
    Views
    160

    In that case, I would suggest treating an array...

    In that case, I would suggest treating an array of char as a stack: whenever you encounter a character that is not a '#', push it into the stack. When you encounter a '#', pop from the stack if the...
  13. Replies
    7
    Views
    160

    Is your aim actually to replace each '#' with...

    Is your aim actually to replace each '#' with '\b', or is it to remove each '#' from the string?
  14. printf works with a format string. So you need to...

    printf works with a format string. So you need to specify a format string such as:

    printf("%d\n", fahrenheit_to_celsius(5));
    but note that your calculation uses integer arithmetic, which probably...
  15. Replies
    6
    Views
    183

    I think you need to rally your other students and...

    I think you need to rally your other students and collectively appeal for some kind of deadline extension until such time that classes have resumed so that you and your classmates can actually be...
  16. Replies
    5
    Views
    190

    How does it not work? For example, what is your...

    How does it not work? For example, what is your test input, expected output, and actual output? How did you arrive at the expected output from the test input (i.e., verify that you own calculations...
  17. By the way, did you really name the source file...

    By the way, did you really name the source file "IsMyFriendCheatingV5.C", as in with a ".C" (uppercase) rather than ".c" (lowercase) name suffix/extension? If so, you should be aware that some...
  18. What is the exact code that you tested? What is...

    What is the exact code that you tested? What is the test input, expected output, and actual output?
  19. Let's go back to what you wrote in post #1: ...

    Let's go back to what you wrote in post #1:

    From the phrase 'custom terminating character like "0x9999 "', we can infer that "0x22 0x023 0x24" isn't a null-terminated string of length 15; rather...
  20. I hate to say this, but... while it has its fair...

    I hate to say this, but... while it has its fair share of bugs, GCC is probably fine. It is your code that is not good.

    For example, now that I can see that you updated post #3 with the code that...
  21. Perhaps you should consider using a more...

    Perhaps you should consider using a more sophisticated algorithm such that you can avoid excessive memory usage, or perhaps it may be a good idea to store not currently used data to disk?
  22. Replies
    19
    Views
    396

    The text files aren't inside the crontab. Rather,...

    The text files aren't inside the crontab. Rather, each filename is supplied as a command line argument to the program that is executed via cron, hence they appear in the crontab after the program...
  23. Replies
    19
    Views
    396

    Refer to an English dictionary entry on "day"...

    Refer to an English dictionary entry on "day":

    This is obviously the intended meaning both from context and since we're talking about cron.

    Instead of arguing, it'll be easier just to clarify...
  24. Replies
    19
    Views
    396

    Yes, it is. If you cannot adequately communicate...

    Yes, it is. If you cannot adequately communicate what you're trying to do in English (or some other human natural language), then you will have problems doing the same correctly in code... or in a...
  25. Replies
    19
    Views
    396

    I don't understand what you're saying here: C is...

    I don't understand what you're saying here: C is limited to 256 what? A database will end up with more lines? But a database usually conceptually consists of records, not lines, even if a record in a...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4