#include <stdio.h>
#include <stdlib.h>
int x;
int y; int *p;
int t;
float y1; float *p1;
float f;
char y2; char *p2;
char c;
double y3; double *p3;
double d;
unsigned y4; unsigned *p4;
unsigned u;
int pos;
main()
{
t = sizeof(x);
printf("el entero ocupa %d byte\n", t);
printf("la posicion del entero es %d\n", &t);//que debo poner?
printf("el valor del entero es %d\n\n", x);
t = sizeof(f);
printf("el float ocupa %d byte\n", t);
printf("la posicion del float es %d\n", &f);
printf("el valor del float es %d\n\n", f);
t = sizeof(c);
printf("el char ocupa %d byte\n", t);
printf("la posicion del char es %d\n", &c);
printf("el valor del char es %d\n\n", c);
t = sizeof(d);
printf("el double ocupa %d byte\n", t);
printf("la posicion del double es %d\n", &d);
printf("el valor del double es %d\n\n", d);
t = sizeof(u);
printf("el unsigned ocupa %d byte\n", t);
printf("la posicion del unsigned es %d\n", &u);
printf("el valor del unsigned es %d\n\n", u);
x = 215;
p = &x;
y = *p;
printf("y vale %d\n\n", y);
f = 2.5;
p1 = &f;
y1 = *p1;
printf("f vale %f\n\n", y1);
c = 'a';
p2 = &c;
y2 = *p2;
printf("c vale %c\n\n", y2);
d = 3.16;
p3 = &d;
y3 = *p3;
printf("d vale %lf\n\n", y3);
u = 666;
p4 = &u;
y4 = *p4;
printf ("u vale %u\n\n", y4);
system ("pause");
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.