09 2012 档案

摘要:辅助类:DBHelper类:包括数据库连接字符串、数据库连接对象两个静态公有字段。View Code using System;using System.Collections.Generic;using System.Text;using System.Data.SqlClient;namespace MySchool{ // 存放数据库连接字符串和数据库连接对象 class DBHelper { // 数据库连接字符串 public static string connectionString = "Data Source=.;... 阅读全文
posted @ 2012-09-19 12:21 唐小喵 阅读(2173) 评论(0) 推荐(1) 编辑
摘要:文件读写操作fopen fclose fgetc fputcView Code #include <stdio.h>#include <stdlib.h>int main(){ FILE * fp; char ch; if((fp = fopen("file.txt", "w")) == NULL) //如果文件不存在,自动创建。 不能少一个括号!! { printf("Cannot open this file!\n"); exit(0); } else { printf("File open su 阅读全文
posted @ 2012-09-03 14:15 唐小喵 阅读(480) 评论(0) 推荐(0) 编辑
摘要:第二章#include <stdio.h> #include <stdlib.h> #include <time.h> //插入排序void InsertSort(int A[], int n){ int i, j, key; for(i=1; i<n; i++) { key = A[i]; j = i-1; while(A[j] > key && j>=0) { A[j+1] = A[j]; j--; } A[j+1] = key;... 阅读全文
posted @ 2012-09-02 11:16 唐小喵 阅读(277) 评论(0) 推荐(0) 编辑
摘要:#include "stdio.h"#include "stdlib.h"#include "string.h"typedef int bool;#define true 1#define false 0typedef struct student{ char name[20]; char phone[20]; bool flag; struct student *next;}student;student* Add(student* phead);student* Find(student *phead);void Search(s 阅读全文
posted @ 2012-09-01 08:25 唐小喵 阅读(335) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示