Search:

Type: Posts; User: zensatori

Search: Search took 0.01 seconds.

  1. Oh, so it's one's complement? I'll have to...

    Oh, so it's one's complement? I'll have to re-read that section. I really need to get a copy of "The C Answer Book" ;)

    Thanks again, I really appreciate the help.

    This is such a great book, I...
  2. I have not seen the ~0 or ~value before, where is...

    I have not seen the ~0 or ~value before, where is that coming from? I have seen ~1 used to set boolean values before. I see how it works and it seems straigh forward but I would like to know more...
  3. Got it! Thanks, I wrote out some sample code and...

    Got it! Thanks, I wrote out some sample code and tested the effects. I don't think I have ever read about that before, handy to know.
  4. Where is the ~0UL coming from, is it part ot...

    Where is the ~0UL coming from, is it part ot stdbool or something else. Thanks for the reply.
  5. printf("%lu", ~0UL); Can someone explane how...

    printf("%lu", ~0UL);

    Can someone explane how this is working? Seems like this could be really handy to understand.
  6. That is very helpful as are many of the...

    That is very helpful as are many of the suggestions. I guess I really don't understand stdbool. The man page it not particularly illuminating.

    Thanks for the help.
  7. How do I get printf to display the value?

    How do I get printf to display the value?
  8. Any suggestions for finding the largest possible value of INT?

    In this case I am trying to figure out in code of the largest possible value of an unsigned long int. The problem is that if I just do the math 2^(whatever) i am bound to exceed the size of the value...
  9. Thread: RPN Calc

    by zensatori
    Replies
    5
    Views
    1,997

    Could I take the stuff poped off the stack as...

    Could I take the stuff poped off the stack as chars and then check if they are operators? If not put them in temp ints and preform math on them? Problem I see with that is I am only checking a very...
  10. Thread: RPN Calc

    by zensatori
    Replies
    5
    Views
    1,997

    Read the wikipedia stuff. Does that ASCII...

    Read the wikipedia stuff.

    Does that ASCII solution still work for an input with larger numbers?

    13241
    184781
    +

    Can you tell me how this would look in RPN: 9 (4 - 2) / 4
  11. Thread: RPN Calc

    by zensatori
    Replies
    5
    Views
    1,997

    RPN Calc

    Hey, I was just wondering if anyone could give me some suggestion on writing an RPN calc? I am using a double llist lib that I wrote to push and pop. Can anyone suggest how I can decide if I am...
  12. Thread: time.h

    by zensatori
    Replies
    28
    Views
    3,897

    I get an output like this when i time some...

    I get an output like this when i time some functions

    I will try %g and see what i get.
  13. Thread: time.h

    by zensatori
    Replies
    28
    Views
    3,897

    Yes... Thanks! I feel like a real n00b now....

    Yes... Thanks! I feel like a real n00b now.
    edit: I just changed my output to printf to %f and I get 0.00000 also, same as the guy above. Suggestions?
    edit edit: Never mind, i got it.
  14. Thread: time.h

    by zensatori
    Replies
    28
    Views
    3,897

    yeah, i know. I was just showing the syntax i am...

    yeah, i know. I was just showing the syntax i am using. It is not mean as a exaple of my implimentation. Sorry i didn't make that clear and thanks for the suggestion.
  15. Thread: time.h

    by zensatori
    Replies
    28
    Views
    3,897

    time.h

    Can someone give me a quick example of using time.h to time how long something runs for?

    i would like to output in human readable time.
    I was doing this:


    clock_t start = clock();

    ...
  16. Replies
    7
    Views
    1,944

    Thanks for the suggestion. I kind of forgot that...

    Thanks for the suggestion. I kind of forgot that scanf returns anything :/

    So, my malloc ing looks ok?
  17. Replies
    7
    Views
    1,944

    -bash-3.1$ ./proj1 < 100000.txt 463480570 ...

    -bash-3.1$ ./proj1 < 100000.txt
    463480570
    Array at 101 = 463480570
    *** glibc detected *** ./proj1: realloc(): invalid next size: 0x0969a008 ***
    ======= Backtrace: =========...
  18. Replies
    7
    Views
    1,944

    Malloc, Realloc and Calloc Help/Suggestion

    #include <stdio.h>
    #include <stdbool.h>
    #include "project1.h"


    int main()
    {
    int i, r, NUM_ITEMS, t, ret, ava;
    int* numbers;
    NUM_ITEMS = 0;
  19. Replies
    9
    Views
    1,469

    int i, r, NUM_ITEMS, t, ret; int* numbers;...

    int i, r, NUM_ITEMS, t, ret;
    int* numbers;
    NUM_ITEMS = 0;


    while(((ret = scanf("&#37;d",&t)) != EOF) && (ret != 0))
    {
    printf("%d\n",t);
    numbers = malloc(1 * sizeof(int));...
  20. Replies
    9
    Views
    1,469

    This is what i have to do, I have everything else.

    This is what i have to do, I have everything else.
  21. Replies
    9
    Views
    1,469

    Thanks for the help. int t; while ( t !=...

    Thanks for the help.


    int t;
    while ( t != EOF )
    {
    scanf("&#37;d", &t);
    printf("%d", t);
    }
  22. Replies
    9
    Views
    1,469

    Alright, then what is the terminating char that I...

    Alright, then what is the terminating char that I base my loop on? And way not just malloc and realloc int by int untill EOF?
  23. Replies
    9
    Views
    1,469

    Allocating memory from user input.

    I need to create an array from user input on the fly.

    I am just wondering if anyone can tell me, how is c handeling the input for the command line like this:

    ./arraycreate < input_100.txt
    ...
Results 1 to 23 of 23