Search:

Type: Posts; User: Dave Jay

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,192

    look

    I didn't know what the output meant.

    As usual, my intuition about you was right. Do me a favor and ignore my posts.
  2. Replies
    9
    Views
    2,192

    thats all i wanted to know

    Thanks for the response anonytmouse, and not the typical condescending criticism. Some people tend to forget that other people aren't programmers and have lives outside of a computer.
  3. Replies
    9
    Views
    2,192

    i did run it

    But now I realize that addresses can be different sizes on machines, therefore different byte sizes - scratch the casting operator idea.
    What situation will sizeof not work?
  4. Replies
    9
    Views
    2,192

    sizeof operator

    Why do you need the casting operator to receive the correct size
    of my_array? And what is it outputting if you don't use it?



    #include <stdio.h>

    char * my_array[] = {"string1", "string2",...
  5. Replies
    7
    Views
    1,399

    I'd do something like this if I read you correctly:

    /* Don't name the executable "time.exe", as this is a conflicting
    name in some environments
    */

    #include <stdio.h>
    #define HOURSEC 3600
    #define MINSEC 60

    void my_time(const unsigned,...
  6. Replies
    12
    Views
    3,469

    Now I see it

    "The expression 0x0FFE yields an integer type and can not be dereferenced. You can use a cast to create an expression that yields a pointer type"



    This clears things up a lot.

    Thanks guys
  7. Replies
    12
    Views
    3,469

    I think I understand it

    this is what has been confusing me but I have, I think, figured out my problem. The semantics of words have confused me a bit too. PLease feel free to correct me if I am wrong.

    First, the actual...
  8. Replies
    12
    Views
    3,469

    You guys aren't following me

    consider this definition:


    int *func(int *num)
    {
    return num;
    }


    what does func return?
  9. Replies
    12
    Views
    3,469

    wait, now i dont understand it

    if "func" in your example returns an address of an integer, a constant value, say it's a 32 bit address 0x0030FFEE, then why does the dereferencing operator * work with that returned value? I...
  10. Replies
    12
    Views
    3,469

    yes

    i messed up the syntax. Thanks chief.
  11. Replies
    12
    Views
    3,469

    Can a function appear as an lvalue in C?

    I know it can in C++ returning a reference variable. Thanks
  12. understood

    for( i=0; i<x; i++)
    result += va_arg(arglist,double);



    what you wrote here, each call to va_arg(arglist,double) refers to the next argument after x. What I'm questioning is how to refer back...
  13. accessing the variables in variable length parameters

    My book does a bad job explaining this topic. The way I understand it, each call to the macro va_arg([variable], [type]) refers to the next argument in the parameter list marked by va_start. So, does...
  14. Replies
    3
    Views
    1,285

    yeah but

    why does the input buffer flush when response is declared as int?
  15. Replies
    3
    Views
    1,285

    what is wrong with this simple program?

    This is a simple little menu which doesn't work. After a character is inputted, user input is skipped for the next scanf statement if the loop continues. If response is declared to be int, it works,...
  16. klausi : "Can you exactly define "median"? " ...

    klausi : "Can you exactly define "median"? "

    The median is simply the middle number of a sorted list.
    When there is an even number of numbers, the median is the mean of the two middle numbers.
    ...
  17. Appreciate the responses but

    For "unregistered":

    You were "assuming the list is in an array", which I had said cannot be in memory. The numbers are spit out on the fly, you read them once individually and then they are gone....
  18. Thread: Please Help

    by Dave Jay
    Replies
    7
    Views
    947

    more constraints?

    How would you want the program to handle the following:

    > 3456348908687874545.76456489056456 + 23.444

    > / 17

    > 8 ++ 3

    is there a limit to how long an expression can be?
  19. more of an algorithm question than a C question

    How would you, if it's indeed possible, find the exact median of an unordered list, on the fly?

    For example, how would you find the median of the following list (which is 5) without sorting the...
  20. Replies
    2
    Views
    964

    A few quick comments: char inpt[i]; This...

    A few quick comments:

    char inpt[i];

    This can't be declared with variable length. "i' must be a constant; the complier must know the size of the array beforehand, like you did with char...
  21. Replies
    2
    Views
    827

    while ( cnt != -1 ) the variable cnt is never...

    while ( cnt != -1 )

    the variable cnt is never initialized and you are comparing it - not good. Note that, from what you've wrote, you don't even need it. You can do something like this for(;; )...
  22. Replies
    13
    Views
    2,376

    For Quzah

    You misunderstood me. I was simply implying "call by reference" by passing a pointer to an argument.

    -as in swap(&i, &j);
    void swap(int *x, int *y);

    You looked too deeply.

    Dave
  23. Replies
    5
    Views
    1,772

    Also i would like to know how can i change color...

    Also i would like to know how can i change color of the text to be displayed on the screen and how to keep the text flashing on the screen.

    Specify platform :confused:

    In DOS you can use...
  24. Replies
    13
    Views
    2,376

    I sense you haven't learned passsing by reference...

    I sense you haven't learned passsing by reference yet.
    Here's something more manageable, I followed your semantics :cool: :


    #include <stdio.h>

    int score1, score2, score3;
    char grade;
    float...
  25. memory models

    Depending on the memory segmentation of the cpu, it might not be so bad. For example, using near pointers can't address any OS region of memory in DOS. The worse you'll do is wipe out anything in the...
Results 1 to 25 of 34
Page 1 of 2 1 2