PIXNET Logo登入

S's Journal

跳到主文

部落格全站分類:生活綜合

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 11月 19 週三 201416:17
  • [Error Message] undefined reference to `cos'

出現下列錯誤訊息時,只要在gcc compiler加上後面的 -lm 即可解決。
Rwh_FilterModule.c:(.text+0x1412): undefined reference to `sqrt'
Rwh_FilterModule.c:(.text+0x1430): undefined reference to `cos'
Rwh_FilterModule.c:(.text+0x144a): undefined reference to `sqrt'
Rwh_FilterModule.c:(.text+0x1468): undefined reference to `sin'
Rwh_FilterModule.c:(.text+0x16d4): undefined reference to `cos'
Rwh_FilterModule.c:(.text+0x1718): undefined reference to `cos'
(繼續閱讀...)
文章標籤

S 發表在 痞客邦 留言(0) 人氣(559)

  • 個人分類:標準函式庫
▲top
  • 3月 18 週二 201410:56
  • [ C ] fgets() 超過buffer

1
使用fgets()常會遇到一個問題,輸入的字元數目超過Buffer給定的,就會出現下列的狀況。
狀況:當程式為 fgets( cName, 30, stdin ); 時,輸入超過30 個字元,程式就會每次輸出30個字元直到全部資料被輸出。下列為此種現象程式碼及狀況示意圖 :
#include <stdio.h>
#include <string.h>
int main()
{
char cName[30];
FILE *pFile;

pFile = fopen( "write.csv", "a" );
if( pFile == NULL )
{
printf("open failure");
return 1;
}
while(1)
{
printf("please enter your name: \n");
fgets( cName, 30, stdin );
if( 'E' == cName[0] && ('\n' == cName[1] || '\0' == cName[1] ))
{
break;
}

fwrite(cName, 1, strlen( cName ) , pFile);
memset( cName, 0x00, sizeof( cName ) );

}
fclose(pFile);
return 0;
}
(繼續閱讀...)
文章標籤

S 發表在 痞客邦 留言(0) 人氣(1,433)

  • 個人分類:標準函式庫
▲top
  • 3月 11 週二 201410:05
  • [ C ] gets() scanf() 空白控制

2
gets() 取得使用者輸入的全部字串,包括空白字元。
char * gets ( char * str );
scanf() 取得使用者輸入的字串,遇到空白字元就停止取得。
int scanf ( const char * format, ... );
(繼續閱讀...)
文章標籤

S 發表在 痞客邦 留言(0) 人氣(10,975)

  • 個人分類:標準函式庫
▲top
  • 1月 24 週五 201410:07
  • [ C ] printf() & format specifier 形態格式

blog01
printf()之使用功能為將指定的文字、數字等等...顯示在螢幕上,使用此函數必須先#include <stdio.h>
小試身手小範例(1)
#include <stdio.h>
int main(void)
{
    printf("Innovation distinguishes between a leader and a follower \n");
    printf("by Steven Jobs \n");
}
(繼續閱讀...)
文章標籤

S 發表在 痞客邦 留言(0) 人氣(2,891)

  • 個人分類:標準函式庫
▲top
1

個人資訊

S
暱稱:
S
分類:
生活綜合
好友:
累積中
地區:

AdSense

Google Ad

Rookies

toggle 啟發 (2)
  • 思想舉重 (1)
  • Diary (0)
toggle 香氛 (1)
  • 日本線香 (1)
toggle 工作 (1)
  • 日文學習紀錄 (13)
toggle 旅行 (7)
  • 義大利 羅馬 (0)
  • 法國 巴黎 (0)
  • 英國 倫敦 (1)
  • 梵蒂岡 (0)
  • 日本 沖繩 (6)
  • 日本 東京 (1)
  • 日本 京都 (1)
toggle 資訊工程 (8)
  • Wordpress 網站架設 (2)
  • 主機板 (1)
  • Java 基本 (5)
  • Linux (23)
  • GTK (1)
  • 計算機概論 (12)
  • 軟體工具 (9)
  • plug-in 開發 (4)
toggle Android (8)
  • 使用者介面 (17)
  • Map (2)
  • Sensor (2)
  • 手機控制項 (19)
  • 開發環境 (8)
  • 檔案及資料庫 (7)
  • 排版 (5)
  • 基本觀念 (2)
toggle C 語言 (5)
  • 記憶體指標 (1)
  • 基本應用 (9)
  • 標準函式庫 (4)
  • 前置處理 (1)
  • Message Queue (1)
  • 未分類文章 (1)

最新文章

  • GTM 教學 - 快速部署(Google Tag Manager)
  • 【Wordpress】移除商品頁面的相關產品
  • 【日本香堂】每日香 西洋杉
  • [ROG motherboard] LN2 mode & Slow mode
  • IOPS (Input/Output operations per second)
  • 【 倫敦 】音樂劇訂票 超值打折票
  • 【範本下載】投影片PowerPoint背景
  • 【線上工具】Timeline maker 年表
  • 【架設網站】網站專案成本考量(零)
  • 【線上工具】圖片編輯圓形剪裁

熱門文章

  • (127,631)[Android] 簡易Button事件處理
  • (63,731)[Android] 手機頁面的轉換(setContentView)
  • (11,181)[Android] color.xml
  • (28,553)[Android] 按鈕置換文字顏色及字型 Typeface
  • (339,798)[Android] 使用adb指令
  • (28,678)[Android] Stream方式寫入檔案
  • (36,490)[Android]Button背景透明或半透明
  • (15,080)[Android] G-sensor 加速度
  • (16,292)[Android] SoundPool 音效 (一)
  • (29,395)[ C ] Read 讀檔

文章搜尋

匯率查詢

BloggerAds

參觀人氣

  • 本日人氣:
  • 累積人氣:

自訂側欄