摘要:
"=========================================================================" DesCRiption: 适合自己使用的vimrc文件,for Linux/Windows, GUI/Console"" Last Change: 2010年08月02日 15时13分 "" Version: 1.80""========================================================================= 阅读全文
摘要:
以下是协议栈初始化函数调用层次结构socket.c :BSD socket层,属于表示层,为应用层系统调用提供接口;af_inet.c :INET Socket层,属于会话层,屏蔽底层协议以下是sock_init()函数void sock_init(void){ int i; printk("Swansea University Computer Society NET3.019\n"); /* * Initialize all address (protocol) families. */ for (i = 0; i < NPROTO... 阅读全文
摘要:
struct haha{ unsigned char a:4, unsigned char b:2, unsigned char c:1; unsigned char d:1;};void main(){ haha hhh; hhh.a=15; hhh.b=3; hhh.c=1; hhh.d=1; //printf("%u\t%u\t%u\t%u\n",hhh.a,hhh.b,hhh.c,sizeof(hhh)); haha *h=&hhh; printf("%d\n",*h);}输出结果: 255如果把结构体内的数据稍加修改如下struct h 阅读全文
摘要:
#include<iostream>using namespace std;class A{public: A(int m) { cout<<this<<endl; }};void main(){ for(int i=0;i<5;i++) { A a(1); A *a1=new A(1); cout<<"a的地址:"<<&a<<endl; cout<<"a1的地址:"<<a1<<endl; cout<<endl; }}以下 阅读全文
摘要:
下面是两句话,希望能让我了解一个重要的概念:1,动态变量使用户显示的创建与撤销的,而且动态变量不能直接访问,必须通过指针变量间接访问;2,堆是为动态变量保存的大块内存区域;然后分析下面一条语句:int * pro=new int;new int是动态分配了一个int型的内存空间,为了访问这块内存空间,int* pro定义了一个int型指针变量pro,通过pro指针访问动态分配的这块内存变量Work是一个已经定义的类Work *worker=new Work;同样这个worker是一个动态变量,访问类成员可以用(*worker).DoWash()来操作类成员函数,也可以用worker->D 阅读全文
摘要:
C++实现文件拷贝#include<fstream>#include<iostream>#include<cstdio>using namespace std;void copy(const char*scrfile,const char*destfile){ ifstream in(scrfile); ofstream out(destfile); out<<in.rdbuf(); out.close(); in.close();}void main(){ copy("12.txt","13.txt"); 阅读全文
摘要:
其实没有从理论上开始,我们直接就VS上进行了操作大致如下:1,为一个WEB应用程序添加一个webservers,然后将逻辑层BLL层的方法放入其.CS的method下;在浏览器中运行该webservers,使其激活并获取其网址2,另建一个项目,为其添加服务引用3,在该项目下调用webservers被挂起的方法即可访问被公布的信息 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Drawing;using System.ComponentModel;using System.Windows.Forms;namespace test{ public class father { protected int m=1; //private int a = 2; //受保护的字段可以被继承类访问,但是私有字段不可以 } public class son: 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;namespace mymdf{ class Program { static void Main(string[] args) { string dataDir = AppDomain.CurrentDomain.BaseDirectory; if (dataDir.EndsWith(@"\bin\Debug\") || dataDir.EndsWith( 阅读全文