c语言中的指针被称为c语言的灵魂,也是c语言的重难点。通过一段时间c语言的学习后,现做一些笔记如下。
一、计算机存储规则(小端存储)
假设定义int、short类型的变量并赋值:
int a 0x12345678;
short b 0x5A6B;
…
代码
n -2:5;
x exp(-0.5*n);
x1 fliplr(x);
n1 -fliplr(n);
subplot(211)
stem(n,x,filled,r);
title(x(n);
subplot(212)
stem(n1,x1,filled,b);
title(x(-n));
figure
stem(n,x,filled,r);
hold on
stem(n1,x1,filled,b);结果