Search:

Type: Posts; User: aghast

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds; generated 5 minute(s) ago.

  1. Replies
    10
    Views
    401

    Two things: john.c has shown you a great...

    Two things:



    john.c has shown you a great technique for simplifying almost all of your C code. If you are coding on Linux, you can make use of a library called libexplain. The same library...
  2. Replies
    3
    Views
    251

    Are you taking input from the user? Then the...

    Are you taking input from the user? Then the number is a string when you read it, and you have to somehow convert it to an int or float during the input process.

    Are you computing the number, or...
  3. Replies
    12
    Views
    534

    Like a lot of things, it's mainly from habit. ;-)...

    Like a lot of things, it's mainly from habit. ;-)

    I don't use variables (such as const uint8_t num_flexiforce_sensors = 8;) because they are variables, not constants. You cannot use a variable to...
  4. Replies
    3
    Views
    190

    Got any output?

    Got any output?
  5. Replies
    12
    Views
    534

    In function: saadc_sample(struct s_sampling...

    In function: saadc_sample(struct s_sampling *sampling)

    sampling->packet_counter;

    Remove this line, or change the code to support its use. It appears to do nothing, and I do not see any use of...
  6. Replies
    2
    Views
    268

    Break it down in small pieces. ...

    Break it down in small pieces.

    draw_rectangle(x, y)
    - draw ul corner
    - draw top line
    - draw ur corner
    - for loop
    - draw left side
    - draw right side
    - draw bl corner
  7. I don't fully understand your complaint, because...

    I don't fully understand your complaint, because your "error" example looks fine to me -- what should it be doing?

    Regardless, I think you are seeing the behavior that you are, because of the...
  8. Replies
    5
    Views
    376

    Remember that pointers in C have type...

    Remember that pointers in C have type information, but have no limits.

    That is, if I give you a pointer value, such as p = 0x12345678, and say "this is a pointer to struct Foo," you can access a...
  9. Replies
    4
    Views
    488

    I don't see any logic to ensure that the numbers...

    I don't see any logic to ensure that the numbers are in proper order. That is, you never check if a < b, or c < d, prior to doing your other checks. This would be validation and your course may not...
  10. Replies
    6
    Views
    468

    You say that one item is in the wrong place. Is...

    You say that one item is in the wrong place. Is that known? In other words, are you trying to solve a problem that guarantees that exactly one item is in the wrong place? Because that is different...
  11. Replies
    7
    Views
    720

    According to the standard, void * pointers are...

    According to the standard, void * pointers are "wide" enough (that is, they are made up of enough bits) to store any kind of pointer used by the system.

    There are, or have been in the past,...
  12. Replies
    25
    Views
    1,612

    Your print statement is commented out.

    Your print statement is commented out.
  13. Here's a hint: The problem statement...

    Here's a hint:

    The problem statement explicitly calls for column displays. And it appears to require the columns to correspond directly to the numbers entered. So you cannot reorder the numbers...
  14. Replies
    3
    Views
    581

    Create an array of const char * pointers into a...

    Create an array of const char * pointers into a single string. Each pointer must be distinct, but the set of pointers must also be compact.

    Use the _Generic() feature, with a macro, to implement...
  15. Thread: Macro help

    by aghast
    Replies
    3
    Views
    441

    You are passing everything through a call to a...

    You are passing everything through a call to a function. You can make that function into a varargs function by declaring parameters with '...', and then call vfprintf instead of fprintf, passing the...
  16. Replies
    25
    Views
    1,612

    The only errors I saw on your original code were...

    The only errors I saw on your original code were these:



    $ gcc -Wall -Wextra xx.c
    xx.c: In function ‘itoa’:
    xx.c:5:7: error: assignment of read-only parameter ‘input’
    input = -input;
    ...
  17. Replies
    6
    Views
    684

    The default keyword is also used in the...

    The default keyword is also used in the _Generic() expression selector. It still has to be inside the _Generic construct, so there's no way to just randomly scatter default around your code.
    ...
  18. You don't bind a name to a socket on the client...

    You don't bind a name to a socket on the client side. Just create the socket and then send/receive data. (You should send first so that the server, which is the more permanent process, knows to begin...
  19. Replies
    7
    Views
    1,359

    Correct. A factory method is a method that is...

    Correct.

    A factory method is a method that is called to build an instance of a class (or subclass). For this reason, you don't usually call factory methods using a class instance. Rather, you...
  20. Replies
    9
    Views
    809

    You have a node structure which (per the code)...

    You have a node structure which (per the code) contains members like this:


    typedef struct Node {
    int data;
    struct Node * next;
    } Node;

    A single-linked list, which is what you have...
  21. Compilers, especially the Visual Studio compiler,...

    Compilers, especially the Visual Studio compiler, generally have very precise error messages. It may be that the compiler is confused about something, or that you are confused about something, but...
  22. Replies
    16
    Views
    1,003

    This sounds like you are missing some fundamental...

    This sounds like you are missing some fundamental definitions.

    I don't know anything about the code you are using, but I suspect that there is some header file you are supposed to include to...
  23. Thread: macros???

    by aghast
    Replies
    4
    Views
    479

    If you are going to do this, you have a couple of...

    If you are going to do this, you have a couple of choices.

    First, would be a preprocessor macro. Something like:




    #define sendmsg(wc) sendmsg(hwnd, WM_SETTEXT, wcharlength, wc)
  24. Replies
    20
    Views
    1,223

    Suppose you are reading data from a file. The...

    Suppose you are reading data from a file.

    The data are in records. Each record includes name, address, postal code, phone, etc., mostly on separate lines.

    The first line of the file is an...
  25. Replies
    20
    Views
    959

    Is this a bug? err = ArgHasIssue( prv,...

    Is this a bug?


    err = ArgHasIssue( prv, NULL );

    if ( err )
    return ArgHadIssue( err, arg );
Results 1 to 25 of 64
Page 1 of 3 1 2 3