Answers for "* in c"

1

poiner in c

int* pc, c, d;
c = 5;
d = -15;

pc = &c; printf("%d", *pc); // Output: 5
pc = &d; printf("%d", *pc); // Ouptut: -15
Posted by: Guest on July-01-2020
1

%.*s in c

example:
printf("%.*s",3,"hello");

output:hel
here 3 represents the length of the string to be printed in the "hello string".
Posted by: Guest on May-11-2020
2

poiner in c

int c, *pc;

// pc is address but c is not
pc = c; // Error

// &c is address but *pc is not
*pc = &c; // Error

// both &c and pc are addresses
pc = &c;

// both c and *pc values 
*pc = c;
Posted by: Guest on July-01-2020
0

poiner in c

#include <stdio.h>
int main()
{
    int var =10;
    int *p;
    p= &var;

    printf ( "Address of var is: %p", &var);
    printf ( "\nAddress of var is: %p", p);

    printf ( "\nValue of var is: %d", var);
    printf ( "\nValue of var is: %d", *p);
    printf ( "\nValue of var is: %d", *( &var));

    /* Note I have used %p for p's value as it represents an address*/
    printf( "\nValue of pointer p is: %p", p);
    printf ( "\nAddress of pointer p is: %p", &p);

    return 0;
}
Posted by: Guest on July-01-2020

Code answers related to "Objective-C"

Browse Popular Code Answers by Language