[問題] 求救,關於C的pthread問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Dev C++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
pthread.h
問題(Question):
學校作業要求用pthread實作任何一種sort,我原本在全域變數的地方宣告好
一個陣列的話(註解部分)可以好好的完成sort,但是變成用指標建成陣列的話
就不能好好排列了,想請問各位前輩們問題是出在哪裡呢?難道是指標不能宣告
在全域嗎?麻煩了,不好意思><
餵入的資料(Input):
18
20 5 99 84 68 52 45 65 3 2 22 84 98 94 76 11 9 7
預期的正確結果(Expected Output):
2 3 5 7 9 11 20 22 45 52 65 68 76 84 84 94 98 99
錯誤結果(Wrong Output):
5 20 99 84 68 52 45 65 3 2 22 84 98 94 76 11 9 7
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/caxd5i9l
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.231.113.60
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1446832015.A.28F.html
推
11/07 04:43, , 1F
11/07 04:43, 1F
→
11/07 04:44, , 2F
11/07 04:44, 2F
推
11/07 05:24, , 3F
11/07 05:24, 3F
→
11/07 05:25, , 4F
11/07 05:25, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章