IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CData Types & Operators : Understanding Pointers
<02.08>
/* Problem: This program just demonstrates how to assign values to pointer variables. It serves no other purpose. */ #include <stdio.h> int main (void) { /* c and d are pointers to integers */ int a, b, *c, *d, e; a = 10; b = a * 3; c = &a; /* address of a goes into c */ d = &b; /* address of b goes into d */ e = *c + *d; /* *c is a and *d is b */ *d = a; d = &a; *c = *d - a % b + *c; printf ("Do you understand why\n"); printf ("a= %d, b= %d, e= %d ?\n", a, b, e); return (0); }
Hergestellt in Deutschland / Made in Germany
Do you understand why a= 20, b= 10, e= 40 ?
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland