Search:

Type: Posts; User: jimmianlin

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,124

    pointer vs reference

    When you call a function, I understand why it is dangerous to pass a pointer to a local variable as the return value for that function. However, why is it generally safe to pass a reference to a...
  2. Replies
    3
    Views
    4,407

    adding zeros to front

    If I wanted to display a bunch of people's IDs, that are each 9 digits long in hex. How would you make it so that if a person's iint stores 9A3E1, you would be able to print 00009A3E1 and latch on...
  3. Replies
    2
    Views
    1,416

    truncating front

    Hi

    if I have an integer for instance
    int x= -3

    and I try to print it in hex
    printf("%X", x);

    It prints out FFFFD.
  4. Replies
    1
    Views
    1,023

    dyn mem alloc

    In the new C99 version of C, it is then possible to create arrays with variable length. Does that mean that dynamic memory allocation is pretty much obsolete? What else does dynamic allocation offer?
  5. Replies
    4
    Views
    1,112

    strange c array

    I wrote a small snippet of C code. Ignore the strange "sentence" name. My question is, why is it that when I call strlen on this array, it prints 5, instead of 2? Thanks.



    int main(){
    char...
  6. Replies
    2
    Views
    872

    warning regarding size

    I tried to compile the following code, and had a warning: passing arg 1 of 'printf' makes pointer from integer without a cast. I tried different things to stop this but to no avail. Does anyone have...
Results 1 to 6 of 6