原创 linux下的高級文件編程

測試文件類型 #include <stdio.h> #include <sys/stat.h> int main( int argc, char *argv[] ) { struct stat statbuf;

原创 C語言掃雷

1.linux下完成成 2.通過打印不同背景,實現光標功能 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define TTY_PATH "/dev/tty" #

原创 c語言俄羅斯方塊

linux實現 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define TTY_PATH "/dev/tty" #define STTY_ON "stty

原创 string的標準庫練習

#include <stdio.h> #include <assert.h> size_t strlen(const char *s); void *memset(void *src, int n, size_t count); cha

原创 使用printf打印不出信息

許多新人剛學習C語言的時候,使用printf發現打印不出自己想要的內容,以爲是其他bug,造成諸多麻煩 其實是printf 的問題 其要打印必須有以下四個條件中的一個 1. 輸出緩存區填滿,這個很難測試其緩存區到底有多大。 2. 程序結

原创 指針和數組的轉換

本人喜歡例子說明。。 <pre name="code" class="cpp"><span style="font-size:18px;">#include <stdio.h> int main() { int arr[4] = {1

原创 C++可變長不確定類型的參數

#include "stdafx.h" #include <cstdarg> #include <string.h> #include "iostream" using namespace std; typedef struct Pa

原创 syslog

syslog是Linux中設置系統日記的一種工具。主要有三個函數openlog,syslog,closelog。 需要的庫 #include <syslog.h> void openlog(const char* ident, i

原创 eclipse的搜索和調試

對於剛進入公司,但又要快速融入公司的項目的朋友們。 一定要會eclipse的兩個方法。這可以省去問前輩過多而引發的事件...... 搜索和調試,如果一看就知道我要說什麼的盆友們路過...路過... 一、先說搜索吧。 (1)使

原创 c語言貪吃蛇

這個小遊戲,無聊時敲得。 1.運行環境ubuntu版本c89下,基本能兼容。 2.實現了非堵塞的輸入。 3.每次吃一個,都會變長 4.採用鏈表完成 #include <stdio.h> #include <stdlib.h> #inclu

原创 recvmsg和sendmsg

這兩個函數是最通用的I/O函數。實際上我們甚至可以說用recvmsg來代替read、readv、recv和recvfrom。sendmsg也類似。 需要的頭文件 #include<sys/socket.h> 函數原型 ssize_

原创 myeclipse使用jquery-easyui

第一: 準備myeclipse環境 準備安裝包spket-1.6.18.jar和js文件,這裏我上傳了http://download.csdn.net/detail/u010439954/9090323 第二: 運行cmd 轉到spke

原创 CallableStatement的實例

一、概念 CallableStatement 對象用於執行對數據庫已存在的存儲過程的調用。     二、先對存儲過程語法說明 1、先配置一個存儲過程 http://blog.csdn.net/u010439954/article/det

原创 c語言的隱式轉換

此次測試是在ubuntu下 對於C語言數據類型 sizeof char 1個字節 short 2個字節 int 4個字節 long 4個字節 float 4個字節 double 8個字節 本人通過使用兩個不同數據類型的

原创 2048小遊戲

以下特點 1.linux下完成 2.非堵塞鍵盤讀取 3.隨機生成2和4 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define TTY_PATH "/dev/