您好,我有這個功能ç直方圖錯號
int printofarray(int *j,double *n)
{
int x,k;
k=*j;
if(n==NULL) {
printf("array was not created\n");
return 1;}
for(x=0;x<k;x++){
printf("%.2lf\n",*(n+x));}
return 0;
}
當我使用它的輸出是這樣
34.77
6114.05
410.70
,但我想他們寫這樣
34.77
6114.05
410.70
想法如何?
請空格和英文!另外,不要強制使用'malloc()'的返回值。 – 2012-11-17 16:11:23
malloc有什麼問題? –
@userXXX [這是錯誤的,你使用3個問號。](http://stackoverflow.com/questions/605845/do-i-cast-the-result-of-malloc) – 2012-11-17 16:22:31