东莞苹果代工厂万余工人因中秋福利取消停工 (转载)# PDA - 掌中宝
m*n
1 楼
下面代码,如果把所有*去掉,结果是对的,
但我需要用指针传递数据,所以都用了指针,编译后,
结果就是Segmentation fault
帮看看为啥啊
#include
#define MAX 10
main()
{
int *row;
int *column;
int *total;
*row=1;
*column=1;
*total=0;
while(*total {
if(*column==*row)
{ printf("%4d",((*column)*(*row)));
*column=1;
(*row)++;
(*total)++;
if(*total }
else
{printf("%4d",((*column)*(*row)));(*column)++;(*total)++;}
}
printf("F\n");
}
但我需要用指针传递数据,所以都用了指针,编译后,
结果就是Segmentation fault
帮看看为啥啊
#include
#define MAX 10
main()
{
int *row;
int *column;
int *total;
*row=1;
*column=1;
*total=0;
while(*total
if(*column==*row)
{ printf("%4d",((*column)*(*row)));
*column=1;
(*row)++;
(*total)++;
if(*total
else
{printf("%4d",((*column)*(*row)));(*column)++;(*total)++;}
}
printf("F\n");
}