C\C++
xxaizai
这个作者很懒,什么都没留下…
展开
-
文件复制
#include "stdio.h"int main(int argCount, char *argValue[]){ FILE* srcFile=0; FILE* desFile=0; int ch=0; if(argCount!=3){ printf("Usage:%s sourcefile destinationfile...原创 2012-11-01 20:46:32 · 166 阅读 · 0 评论 -
字符串复制
#include "iostream.h"#include "assert.h"#include "string.h"char* strcopy(char* strDest,const char* strSrc);int main(){ char* s="hello,Miss!"; char str[20]; int len=strlen(strcopy(st...原创 2012-11-01 21:27:29 · 107 阅读 · 0 评论 -
关于指针
指针是什么? K&R中关于指针一词做如下解释: 指针是一种保存变量地址的变量,在C中频繁地使用。这种解释直接有把指针当做变量的意思,但是事实并非如此。 经常说的指针实际上是指“指针类型”、“指针类型变量”、“指针类型的值”。 像int a=5;一样,有“int类型”、“int类型变量”(a)、“int类型的值”(5)。 ...原创 2014-03-20 16:18:34 · 105 阅读 · 0 评论 -
C是怎样使用内存的
1、应用程序面对的地址实际是虚拟地址空间,每一个进程分配了一个独立的虚拟地址。printf输出地址值输出的并不是真实的物理地址。#include <stdio.h>int main(){ int hoge; char buf[256]; printf("&hoge...%p\n",&hoge); printf("inpu...原创 2014-04-29 19:46:54 · 129 阅读 · 0 评论