Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. If you really want to use a variable-size array,...

    If you really want to use a variable-size array, then maybe something like this.
    I also randomized the values.


    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    void printboard(int...
  2. #include #include #include...

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    #define SIZE 5

    void printboard(int board[][SIZE]);

    int main() {
    int board[SIZE][SIZE];
  3. #include typedef unsigned char...

    #include <stdio.h>

    typedef unsigned char uchar;

    int main() {
    uchar packet[102] = {'\xFF', '\xFF', '\xFF', '\xFF', '\xFF', '\xFF'};
    uchar mac[6] = {0, 0, '\xAA', '\xBB', '\xCC',...
  4. Replies
    2
    Views
    75

    For the printf family of functions, %i is exactly...

    For the printf family of functions, %i is exactly the same as %d. However, for the scanf family, %i accepts octal input (with a leading 0) and hex input (with a leading 0x), whereas %d is only for...
  5. Replies
    7
    Views
    121

    Adrian's point is that if the input file is...

    Adrian's point is that if the input file is simple enough, something like this may do what you want.


    #include <fstream>
    #include <iostream>
    #include <sstream>
    #include <string>

    int main()...
  6. The range of [-32,767, +32,767] for an int is...

    The range of [-32,767, +32,767] for an int is only the minimum range guaranteed by the standard. It would only usually be that limited on a 16-bit system. (And even there the lowest value would be...
  7. Replies
    27
    Views
    296

    OK. I don't have the time to teach you basic math.

    OK. I don't have the time to teach you basic math.
  8. Replies
    27
    Views
    296

    The answer should be in feet, not miles per hour.

    The answer should be in feet, not miles per hour.
  9. Replies
    27
    Views
    296

    I'm asking if you even understand the question.

    I'm asking if you even understand the question.
  10. Replies
    27
    Views
    296

    Can you do question 1 on a calculator? What is...

    Can you do question 1 on a calculator?
    What is the answer if v is 50 miles per hour and theta is 20 degrees?
  11. Replies
    4
    Views
    151

    The 192.168... address is class C private...

    The 192.168... address is class C private address, perhaps assigned by your router.
    The 172.18... address is a class B private address, maybe assigned by your university?
    What public IPv4 do you...
  12. Replies
    4
    Views
    143

    Example input and associated output would be...

    Example input and associated output would be helpful.

    @Hodor, I bet it was typed on an iphone!
  13. Structure makes a good point that you can just...

    Structure makes a good point that you can just sort the entire lines as strings.


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    #define MAX_RECORDS 200
    #define MAX_LINE 100
  14. But isn't that just alphabetical order, like the...

    But isn't that just alphabetical order, like the first version I posted uses? That version also assumes the second number (after the comma) is always 0, but that seems to be your situation. It also...
  15. What are you talking about??? @Tricica, all...

    What are you talking about???

    @Tricica, all you need to do is read all the records into an array of structs and then sort the array. Note that you have not shown a numeric sort on the numbers,...
  16. Replies
    4
    Views
    167

    That identifier doesn't appear in your...

    That identifier doesn't appear in your code.[/COLOR]
  17. Replies
    5
    Views
    154

    So putting it all together, with simplified...

    So putting it all together, with simplified names.
    Still I wonder what the point of the second level of indirection might be.


    #include <stdio.h>

    typedef int (*PF)(int);
    typedef PF const...
  18. Replies
    5
    Views
    154

    I don't get the first issue either. I don't see...

    I don't get the first issue either. I don't see what another level of pointers achieves. Can you show the code where itype is set and where it is called?

    For the second issue, the fact that the...
  19. Did you google "windows exclusive access to...

    Did you google "windows exclusive access to device"?
  20. Your problem description is unintelligible and...

    Your problem description is unintelligible and your code is illegible (and the header is missing). If you don't care, why should we?
  21. solidusMGS? More like gaseousMGS! Am I right...

    solidusMGS?
    More like gaseousMGS!
    Am I right people?!
    People???
  22. I doubt anyone understands that. :confused:

    I doubt anyone understands that. :confused:
  23. Replies
    1
    Views
    125

    "verylong" is usually called BigNum, or similar....

    "verylong" is usually called BigNum, or similar. "verylong" makes me think of a typedef for long long or some implementation-defined larger value (e.g., __int128).

    sizeof(result) is the size of a...
  24. Replies
    2
    Views
    138

    How can we possibly tell you what you did wrong...

    How can we possibly tell you what you did wrong if you show no code?
    Why does Desktop have a windows-style backslash before it instead of the *nix-style forward slash?
    What do you mean "split the...
  25. I didn't even notice he left out the * CHAR_BIT...

    I didn't even notice he left out the * CHAR_BIT too! I even had a * 8 in my little test. But presumably it should use an unsigned long long instead of size_t since size_t is not guaranteed to be...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4