Search:

Type: Posts; User: orientuser

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    3,487

    As the book said, you can certainly copy a...

    As the book said, you can certainly copy a structure like this:

    WordCopy[i]=Word[i];

    Maybe you copied the array of structures instead of the structure itself like this:

    WordCopy=Word;
    Of...
  2. Thread: Difference?

    by orientuser
    Replies
    5
    Views
    1,004

    no difference

    no difference
  3. Replies
    6
    Views
    1,465

    int array[][] = {0, 1, 2, 3, 4, 5, 6, 7, 8};...

    int array[][] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
    It's grammatically incorrect.
  4. Replies
    2
    Views
    1,448

    cas is right. "I want to be able to pass...

    cas is right.

    "I want to be able to pass arrays of float values as well as arrays of double values to the function."
    -- If you really want to do so, you must use function overriding in C++.
    ...
  5. Replies
    8
    Views
    978

    Since the arrays are local, i.e. declared in a...

    Since the arrays are local, i.e. declared in a function, you must pass them as arguments to your new function.
    I think the following code can work as you expect.


    for (i=0; i < numoflines;...
  6. Thread: 1>>5(?)

    by orientuser
    Replies
    2
    Views
    832

    output is 0

    output is 0
  7. Replies
    8
    Views
    978

    May I ask you some questions? 1 Are the arrays,...

    May I ask you some questions?
    1
    Are the arrays, such as year, month, local or global?

    2
    since one of the 'if' conditions is if (year[j] == year[j+1])
    why did you exchange the values of...
  8. Thread: Pointers...

    by orientuser
    Replies
    7
    Views
    1,086

    If mec is an auto local variable(no static...

    If mec is an auto local variable(no static precedes volatile unsigned int), they are identical.
  9. Replies
    8
    Views
    1,896

    sorry, i made a mistake. In the 1st code snippet,...

    sorry, i made a mistake. In the 1st code snippet, args is a pointer to struct aggregator_t, not a structure variable.
  10. Replies
    9
    Views
    7,768

    memcpy (x, (const void *)&y, 2); & is...

    memcpy (x, (const void *)&y, 2);

    & is redundant.
  11. Replies
    9
    Views
    7,768

    The binary code of one of the 2 bytes in y is...

    The binary code of one of the 2 bytes in y is 10010110. If this byte is regarded as a signed char, its value is just -106.

    BTW: A plain char might be regarded as signed char or unsigned char,...
  12. Replies
    8
    Views
    1,896

    They are different. In the 1st code, a structure...

    They are different.
    In the 1st code, a structure variable named args is declared and then args is an object. In the 2nd code, however, args is a new alias for the type "struct aggregator_t *" .
Results 1 to 12 of 12