[問題] 關於呼叫的問題

看板C_and_CPP (C/C++)作者 (異形)時間16年前 (2009/06/01 23:39), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
其實我是在寫一個fixed point FFT的程式 我寫了一個quatisize的函式 如下 int quantisize() { int sign; int a; int out=0; float base,base1; float input; input=-1.25; ////////////////////quantisize//// if (input>=0) sign=0; else { input=0-input; sign=1; } base=pow(2,n-1); base1=base; for (a=0 ;a<N ;a++) { base=base/2; if(input>=base1) { out=out+(1<<(N-a-1)); base1=base1+base; } else { out=out; base1=base1-base; } } if(sign==1)out=0-out; else out=out; system("PAUSE"); return ; } ================================================ 之後我想在main 裡面呼叫這個程式 把在main裡面的小數陣列用迴圈丟進上面那個函式 也就是裡面的input 之後取裡面的out出來丟到main裡面的整數陣列 不過我的C很弱.....所以想請問各位大大要如何寫才好 不好意思 真是麻煩大家了@@ 謝謝~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.168.178.213

06/02 04:15, , 1F
int quantisize(folat intput[]),return out; !?
06/02 04:15, 1F
文章代碼(AID): #1A8_OVJy (C_and_CPP)
文章代碼(AID): #1A8_OVJy (C_and_CPP)