Linux: Mandrake 9.1
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 260   5
URL.หัวข้อ / URL
Linux: Mandrake 9.1


5 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R04173
วันเสาร์อาทิตย์นี้ผมได้เข้ารับการฝึกอบรมหลักสูตร การสร้าง Software ด้วย c/c++ บน Linux
ตอนนี้กำลังมึนกับโค้ดต่างๆ ของ c อยู่ครับ

ถ้าใครสนใจอยากได้เอกสารประกอบการฝึกอบรม ให้ไปเอาที่ http://opensource.kku.ac.th/open/news/cprog-1.pdf

และผมได้มีโอกาสลง Mandrake 9.1 ด้วย เลยนำหน้าตามาให้เพื่อนๆ ได้ดูกัน

ข้อสังเกตคือ Mandrake 9.1 จะลงได้ไว้กว่า Linux TLE และ Red Hat มาก หน้าตาก็สดใสกว่ากัน จะคล้ายๆ Windows มากกว่าเพื่อน

ที่ผมเคยได้ยินมา Mandrake จะสนับสนุนภาษาไทยก่อนเพื่อน แต่ยังงัยก็ยังชอบ Red Hat อยู่ คงเป็นเพราะผมคุ้นเคยกับหน้าตา และหาอะไรต่ออะไรได้ง่าย ถึงแม้จะเป็นตัวที่ต้องสอบให้พูดภาษาไทยเองก็ตามครับ

2 @R04176
ผมลองค้นหาเว็บที่สอน c ได้เจอเว็บ http://www-staff.mcs.uts.edu.au/~kevin/teaching/32510/lectures/lecture1/index.html เห็นว่าน่าสนใจดี เลยนำมาฝากด้วย แต่ไม่แน่ใจนะครับว่าดีแค่ไหน เพียงแต่ผมเจอเป็นอันแรกเลยนำมาให้ดูก่อนครับ
3 @R04180
หรือดูตัวอย่างการเขียนโค้ด floor() ที่ http://developer.novell.com/ndk/doc/clib/index.html?page=/ndk/doc/clib/prog_enu/data/sdk369.html
4 @R04241
ตัวอย่างการเขียนโค้ดภาษา ซี ในการทำ Bubble Sort ให้ดูที่ http://www.metalshell.com/static/code_105.shtml ครับ
5 @R04244
ตัวอย่างโค้ดภาษา ซี ในการติดต่อฐานข้อมูลใน MySQL ดูได้ที่
http://www.metalshell.com/view/source/18/ ครับ

/* mysqlclient.c written by detour@metalshell.com
*
* This example will connect to a mysql database and select
* all rows from your table
*
* Note: When compiling you need to include libmysqlclient.so
* assuming that libmysqlclient.so is in /usr/lib use
* gcc -o mysqlclient mysqlclient.c -lmysqlclient
*
* If you have libmysqlclient.a or you get a compression
* error use
* gcc -o mysqlclient mysqlclient.c -lz /path/to/libmysqlclient.a
*
* http://www.metalshell.com/
*
*/

#include
#include
/* Your mysql.h may be located differently */
#include "/usr/local/mysql/include/mysql.h"

#define table "yourtable"
#define host "localhost"
#define user "user"
#define pass "pass"
#define db "database"

int main() {
MYSQL mysql;
MYSQL_RES *res;
MYSQL_ROW row;

int i=0;
char query[50];

/* make connection to the database */
if(!(mysql_connect(&mysql,host,user,pass)))
{
fprintf(stderr,"mysql_connect() Failed: %s\n",mysql_error(&mysql));
exit(1);
}

/* the database we will use */
if(mysql_select_db(&mysql,db))
{
fprintf(stderr,"mysql_select_db() Failed: %s\n", mysql_error(&mysql));
exit(1);
}

/* Setup the query */
sprintf(query,"select * from %s", table);
if(mysql_query(&mysql,query))
{
fprintf(stderr,"mysql_query() Failed: %s\n", mysql_error(&mysql));
exit(1);
}

/* store the result from our query */
res = mysql_store_result(&mysql);

/* fetch each row from our result and print it */
while((row = mysql_fetch_row(res))) {
for(i=0;i printf("%s\n",row[i]);
}

/* clean up */
mysql_free_result(res);
mysql_close(&mysql);

@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0675s