Search:

Type: Posts; User: kona49er

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    984

    Too bad the compiler did not produce a better...

    Too bad the compiler did not produce a better diagnostic.
  2. Replies
    5
    Views
    984

    It seems like you're not posting all of your...

    It seems like you're not posting all of your code. I would not expect these
    errors from this code frag.
  3. Replies
    7
    Views
    2,660

    Try: c ^= (1ull

    Try:



    c ^= (1ull << n);
  4. Replies
    5
    Views
    1,116

    first mistake, sizeof(char) is 1

    first mistake, sizeof(char) is 1
  5. Replies
    14
    Views
    12,545

    You can convince the compiler you know what...

    You can convince the compiler you know what you're doing by using a cast


    unsigned short* data2 = (unsigned short *)data+3;
  6. your mileage may vary but, if your using an unix...

    your mileage may vary but, if your using an unix environment try the following cli command:

    $ man abs
    ABS(3) NEWLIB

    NAME
    2.4 `abs'--integer absolute...
  7. Replies
    7
    Views
    2,116

    Just curious... That's way to many digits for...

    Just curious... That's way to many digits for human consumption.
    Have you tried using the %e format?
  8. Replies
    8
    Views
    1,116

    You're missing the { after main. (you need a...

    You're missing the { after main. (you need a better compiler :-)
    Look at Endianness - Wikipedia, the free encyclopedia. Come back if you still don't get it.
  9. Replies
    10
    Views
    25,784

    I would not be swapping the bytes. This assumes...

    I would not be swapping the bytes. This assumes you know something about
    the system architecture. It would not work if you wrote the data on a system
    with one Endian and read it back on a system...
  10. Replies
    6
    Views
    1,046

    It can return to menu! Use the return statement....

    It can return to menu! Use the return statement.
    (lots of room for other improvements in the code)
  11. Replies
    10
    Views
    25,784

    Looks like you're bumping into an endian issue. ...

    Looks like you're bumping into an endian issue.
    Look at Endianness - Wikipedia, the free encyclopedia
  12. Replies
    29
    Views
    7,827

    In the US: it's alive and kicking... It's not...

    In the US: it's alive and kicking...

    It's not clear what has you so depressed but a quick look at monster.com
    reveals this.

    Software Engineering Intern Job in Glendale , California US

    and...
  13. Thread: Urgent help

    by kona49er
    Replies
    1
    Views
    1,558

    It you want to use the data in the array after...

    It you want to use the data in the array after this function returns then you need to define
    the array with a more global scope. (see Scope rules in you C book)

    e.g.

    char figuras[MAX_SIZE];...
  14. Replies
    7
    Views
    4,319

    Here is something that should be portable: ...

    Here is something that should be portable:




    unsigned long int m, n;

    ...

    m = (n & 0xff000000) >> 24;
  15. Replies
    10
    Views
    8,405

    Are you sure it not your mutex lock that's...

    Are you sure it not your mutex lock that's causing you problem. If a thread locks a
    mutex and then sleeps holding the lock that will block the other threads waiting
    for the lock to free.
  16. Replies
    21
    Views
    6,144

    To be precise it's 22 digits, but it an...

    To be precise it's 22 digits, but it an improvement on the initial 9 digits.
  17. Replies
    21
    Views
    6,144

    I don't know about millions of digits but if you...

    I don't know about millions of digits but if you want a quick & easy way to get much
    larger numbers switch to:




    unsigned long long int n;
    ...
    sscanf(argv[1],...
  18. Replies
    19
    Views
    5,254

    Yes, very good suggestions. Thanks.

    Yes, very good suggestions. Thanks.
  19. Replies
    19
    Views
    5,254

    Sure but ... I'm still wondering how the guy...

    Sure but ... I'm still wondering how the guy would know how much memory to malloc.
    He does not know how many words he will be reading.
  20. Replies
    19
    Views
    5,254

    With a single pointer, how would he know how much...

    With a single pointer, how would he know how much memory to malloc? I seems like
    he wants this array to grow dynamically (no bounds on the first dimension).
  21. Replies
    19
    Views
    5,254

    Hmmm. Are you sure you want to make the first...

    Hmmm. Are you sure you want to make the first dimension dynamic? You will need
    some place to store the pointers for the dynamically allocated memory. If you need
    this to be all dynamic, maybe a...
  22. Replies
    5
    Views
    1,385

    It's hard to know were to start. Other that...

    It's hard to know were to start. Other that what's been noted thus far, one glaring
    mistake is that none of the code after the return statament will get executed.
  23. Replies
    12
    Views
    1,891

    The following code runs fine on cygwin compiled...

    The following code runs fine on cygwin compiled with gcc.




    #include <stdio.h>

    int main()
    {
    char * rb = "hij";
  24. Replies
    12
    Views
    1,891

    Yes, my bad. It does work with gcc but that's not...

    Yes, my bad. It does work with gcc but that's not a guarantee.
  25. Replies
    12
    Views
    1,891

    [QUOTE=vart;992964]in this case you should...

    [QUOTE=vart;992964]in this case you should declare it as const - since you do not allocate the memory and just have a pointer to the constant string that cannot be modified.



    const char...
Results 1 to 25 of 31
Page 1 of 2 1 2