
本文共 2725 字,大约阅读时间需要 9 分钟。
CSDN������������������������
������������������������
gdb������
gdb ��� GNU ��������������������������� UNIX/Linux ������������������������������������������������������������������������ Linux ���������������������������������������������
������������������
# ������ -g ���������������������g++ -g ./pointer1.cpp -o ./pointer1.outgdb ./pointer1.out
���������������
gbd
������������������gdb start
���������������p a
���������������a
������n
���������������Next���s
������������������Step ������bt
���������������������Back Trace���f 1
������������������Follow Frame���q
���������������
���������������
������������������������������������������
Malloc
/new
������������������(Collectors)���������Makefile ������
Makefile ���������������������������������������������������������������������������������������������������Target: Dependencies������������������������������������������������������
Makefile ������
���������������
������������: ��������� ������
���������
# ���������������CC = g++# ������father.o: father.cpp $(CC) -c $(father) -o father.odau.o: dau.cpp $(CC) -c $(dau) -o dau.o# ���������������������main: $(OBJ) $(CC) -o main $(OBJ)# ������clear: rm -rf *.o
���������������
make
C������������
main ������
main ��� C ������������������������������������������������������������������������������������������������������
main ���������������
_argc
���������������������������������������������������_argv
������������������������������������������������������������
���������������
int main(int argc, char **argv) { // ...}
���������������
������������ (input.cpp
):
#includeint main() { int flag = 1; int i; int count = 0; int sum = 0; while (flag) { scanf("%d", &i); if (i == 0) break; count++; sum += i; } printf("%d,%d\n", sum, count); return 0;}
��������������� (avg.cpp
):
#includeint main() { int sum = 0, n = 0; scanf("%d,%d", &sum, &n); printf("v = %.f\n", sum / n); return 0;}
������������
������������
��������������� IC ������������������������������������������������������������������������������������������������������������������������������������������������������������
������������
** Shell ������**:
# ������������������������������������������./input.out | ./avg.out
������������������������������������
发表评论
最新留言
关于作者
