2008-11-8
http//www.diaomin.org
通过1个月的找工作,发现自己还是太弱了,努力下
一。变量的存储类型
C语言中的变量存储类型有4种,分别为auto(自动变量),static(静态变量),extern(外部变量),register(寄存器变量)
1.全局变量的存储类型:
static和extern两种,其中extern是缺省的全局变量存储类型。
int x,y=5;//默认为外部全局变量
extern int a=1,b=2;//定义外部全局变量,使用关键字extern后,必须进行初始化!
static float f1,f2;//静态全局变量
void main()
{
..........
}
extern型全局变量通过外部全局变量说明可以被其他源程序引用,而static星的全局变量只能局限在本源程序文件中使用
如 ... 阅读全文...
http://msdn.microsoft.com/zh-cn/library/ms228504.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
//如何:串联多个字符串(C# 编程指南)
//class stringConnect1
//{
// static void Main()
// {
// string s1 = "he " + "is " + "a " + "chinese ";
// string s2 = "boy";
// string s3 = @"h
// e"+ "is";//在字符串前面加上@可以按原样输出,而不报错,若不加@则提示“常量中有换行符”
// Console.WriteLine(s1);
// Console.WriteLine(s1+s2);
// Console.WriteLine(s3);
// }
//}
//class stringConnect2
阅读全文...
http://msdn.microsoft.com/zh-cn/library/ms228599.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
//=============修改字符串内容(C# 编程指南)==========
/**/
//=========使用System.Text.RegularExpressions.Regex 类======
//class ReplaceSubstrings
//{
// string searchFor;
// string replaceWith;
// // Custom match method called by Regex.Replace
// string ReplaceMatchCase(Match m)
// {
// // Test whether the match is capitalized
// if (Char.IsUpper(m.Value[0]) == true)
// {
// // Capitalize the replacement string
// // using System.Text; ... 阅读全文...
http://msdn.microsoft.com/zh-cn/library/ms228362.aspx
// 字符串示例,其中string和String是相同的,根据喜好使用
/*
string s1 = null;
String s2 = s1;
String s3 = "";
string s4 = String.Empty;
Console.WriteLine(s2==s3);//输出结果为False
Console.WriteLine(s2 == s4);//输出结果为False
Console.WriteLine(s3 == s4);//输出结果为True;
//以上的s2赋值为null,s3,s4的赋值为空(其中String.Empty为""的替代方法)。
//且由以上输出结果可知null与""是不同的。
const string s5="I'm a chinese";//定义一个 ... 阅读全文...
using System;
class N1
{
//输出参数示例
/*
void sum(int a, int b,out int result)
{
result= a + b;
}
static void Main()
{
N1 n = new N1();
int a = 15, b = 30,r;
n.sum(a, b,out r);
Console.WriteLine("两种之和为:{0}",r);
}
*/
//值参数示例。值不被修改
static void plus(int p)
{
p++;
Console .WriteLine ("p++的值={0}",p);
}
static void Main()
{
int p = 15;
Console.WriteLine("传入的p值:{0}", p);
plus(p);
Console.WriteLine("返回的p值:{0}",p);
}
/*引用参数
static vo ... 阅读全文...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace New2
{
class Program
{
static void Main(string[] args)
{
/*数组示例1==================================================
int[] a = new int[5];//初始化数组a,共有5个元素,从a[0]到a[4]
for (int i = 0; i < a.Length; i++)
{
a[i] = i * i;
}
Console.WriteLine("a.Length={0}",a.Length );
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine("a[{0}]={1}",i,a[i]);//{0}代表第一个参数位置,{1}代表第二个参数位置
}
... 阅读全文...
========================================
/*windows环境下32位汇编语言程序设计(第2版)罗云彬*/|
/*版权所有:chenyihao Email:chenyihao@yeah.net*/
/*Blog:http://www.diaomin.org*/
/*2008年07月28日*/
==========================================
1.学习win32汇编的原因:
一.利用Windows提供的大量函数库,用win32汇编同样可以开发出大型软件.
二.任何汇编语言都是和操作系统相关的,所以win32汇编是不同于Dos汇编的.
三.win32环境下,大部分的高级语言都对实现的细节进行封装,而使用win32汇编可以了解操作系统运行的细节
四.在windows环境下进行加密解密,逆向工程,病毒的分析等工作时,win32汇编是惟一选择.
2.80386的工作模式 ... 阅读全文...