随笔分类 -  [01.01]-c语言

摘要:入门教程:C++中的const限定修饰符 const修饰符可以把对象转变成常数对象,什么意思呢? 意思就是说利用const进行修饰的变量的值在程序的任意位置将不能再被修改,就如同常数一样使用! 使用方法是: const int a=1;//这里定义了一个int类型的const常数变量a; 但就于指针 阅读全文
posted @ 2019-07-14 17:33 landv 阅读(202) 评论(0) 推荐(0) 编辑
摘要:在c/c++中利用数组名作为函数参数传递排序和用指针进行排序的例子。 以下两个例子要非常注意,函数传递的不是数组中数组元素的真实值而是数组在内存中的实际地址。 #include <stdio.h> void main(void) { void reversal(); static int a[10] 阅读全文
posted @ 2019-07-14 16:27 landv 阅读(420) 评论(0) 推荐(0) 编辑
摘要:作为一个长篇的C++入门教程,无论如何也应该有这么个引言,可是文笔并不好的我,想了很久也不知道该如何写。。。。。。 仔细想想,与其把这篇短文当作教程的引言,其实它更应该是一篇引导初学者步入C++殿堂的策论。 几年并不算很长的编程经验,使我感触颇深,痛苦迷茫,以及成功后的喜悦一直交替着伴随我,爱好编程 阅读全文
posted @ 2019-07-14 16:26 landv 阅读(245) 评论(0) 推荐(0) 编辑
摘要:#include "pch.h" #include #include using namespace std; int main() { std::cout << "Hello World!\n"; for (int i = 1; i < 9; i++) { for (int j = 1; j <=i ; j++) { ... 阅读全文
posted @ 2019-03-18 10:37 landv 阅读(3469) 评论(0) 推荐(0) 编辑
摘要:#include "stdafx.h" #include #include int main() { int shake_time = 50; //休眠的时间,为5毫秒 int shake_distance = 10; //移动了10像素 RECT rect; //RECT是一个矩形结构体,相当于保存了一个矩形的四条边的坐标 HWND window = NUL... 阅读全文
posted @ 2018-04-21 20:00 landv 阅读(828) 评论(0) 推荐(0) 编辑
摘要:#include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int i; int fahr,celsius; in... 阅读全文
posted @ 2017-01-15 16:19 landv 阅读(357) 评论(0) 推荐(0) 编辑
摘要:#include#include/*企业发放的奖金根据利润提成,发放规则如下:利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可可提成7.5%;20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之... 阅读全文
posted @ 2015-11-12 11:18 landv 阅读(685) 评论(0) 推荐(0) 编辑
摘要:#include#includevoid main(){ unsigned long input_IP; unsigned int BeginByte, MidByte, ThirdByte, EndByte; unsigned int_rotate = 0x07; prin... 阅读全文
posted @ 2015-11-12 10:52 landv 阅读(1583) 评论(0) 推荐(0) 编辑
摘要:#include#include#define BUFFERSIZE 1024/*允许处理的最长行有1024个字符*//*编译环境vs2013*/void main(){ int a, b, sum; /*将输入的两个数分别存储在变量a和b中,sum=a+b*/ char... 阅读全文
posted @ 2015-11-11 14:04 landv 阅读(353) 评论(0) 推荐(0) 编辑
摘要:// ConsoleApplication4.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include#include#include#include#include/********函数变量声明********/#define PR_Box printf(... 阅读全文
posted @ 2015-11-11 13:44 landv 阅读(1887) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #define LENGTH 8 4 5 void main() { 6 int i, j, tmp, number[LENGTH] = { 95, 45, 15, 78, 84, 51, 24, 12 }; 7 8 for ... 阅读全文
posted @ 2014-04-14 17:00 landv 阅读(549) 评论(0) 推荐(0) 编辑
摘要:风雨20年:我所积累的20条编程经验Posted by zhaoxingyun on 十一月 13th, 2010 | Comments off原文作者乔纳森·丹尼可(Jonathan Danylko)是一位自由职业的web架构师和程序员,编程经验已超过20年,涉足领域有电子商务、生物技术、房地产、... 阅读全文
posted @ 2014-04-14 09:18 landv 阅读(188) 评论(0) 推荐(0) 编辑
摘要:再C语言里面使用system函数调用pause。1 system("pause");会显示 请按任意键继续. . .1 system("pause ->nul");使用这句就不显示了 阅读全文
posted @ 2014-04-13 16:14 landv 阅读(486) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 项目:快说你是猪 3 作者:landv 4 时间:2014年3月12日 5 编译环境:VS2013 6 */ 7 #pragma warning(disable:4996) //全部关掉 8 #pragma warning(once:4996) //仅显示一个 9 #include 10 #include 11 #include 12 13 #define u "我是猪"14 char zhu[30] = "adaklw";15 int i = 0;16 17 void s_cmd()//倒计时关机18 {19 system("t 阅读全文
posted @ 2014-03-12 20:14 landv 阅读(1517) 评论(0) 推荐(0) 编辑
摘要:概述Win32程序的开头都可看到:#include WINDOWS.H是一个最重要的头文件,它包含了其他Windows头文件,这些头文件的某些也包含了其他头文件。这些头文件中最重要的和最基本的是:WINDEF.H 基本数据类型定义。WINNT.H 支持Unicode的类型定义。WINBASE.H Kernel(内核)函数。WINUSER.H 用户界面函数。WINGDI.H 图形设备接口函数。这些头文件定义了Windows的所有资料型态、函数调用、资料结构和常数识别字,它们是Windows文件中的一个重要部分。文件路径 Windows 64位系统: C:\Program Files (x86). 阅读全文
posted @ 2014-03-11 14:00 landv 阅读(12726) 评论(0) 推荐(0) 编辑
摘要:关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法Visual Studio 2013 编译旧的multi-byte character setMFC 出现错误 1 error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. S 阅读全文
posted @ 2014-03-09 20:05 landv 阅读(1405) 评论(0) 推荐(0) 编辑
摘要:简介stdlib 头文件即standard library标准库头文件stdlib 头文件里包含了C、C++语言的最常用的系统函数该文件包含了C语言标准库函数的定义stdlib.h里面定义了五种类型、一些宏和通用工具函数。 类型例如size_t、wchar_t、div_t、ldiv_t和lldiv_t; 宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等; 常用的函数如malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()、exit()等等。 具体的内容你 阅读全文
posted @ 2014-03-08 22:39 landv 阅读(1797) 评论(0) 推荐(0) 编辑
摘要:传统 C++1234567891011121314151617#include //设定插入点#include //字符处理#include //定义错误码#include //浮点数处理#include //文件输入/输出#include //参数化输入/输出#include //数据流输入/输出#include //定义各种数据类型最值常量#include //定义本地化函数#include //定义数学函数#include //定义输入/输出函数#include //定义杂项函数及内存分配函数#include //字符串处理#include //基于数组的输入... 阅读全文
posted @ 2014-03-08 22:33 landv 阅读(178) 评论(0) 推荐(0) 编辑
摘要:引用地址:http://baike.baidu.com/link?url=U9h6MccLYX2w5uyVOqIFd3eps5gR2FZA10jYRLRnc66Ff_F5ZrmXGKA12DT-_2xfzjl8MXCa-BBJDrj1x3cgm_1分类函数2数学函数3目录函数4进程函数5诊断函数6接口子程序7操作函数8时间日期函数分类函数所在函数库为【ctype.h】int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0int isalnum(int ch) 若ch是字母(&# 阅读全文
posted @ 2014-03-08 21:53 landv 阅读(411) 评论(0) 推荐(0) 编辑
摘要:要形成包含多个行的字符串,可以串联两个字符串。为此,请键入正斜杠,然后按 return 键。反斜杠导致编译器忽略以下换行符。例如,字符串"Long strings can be bro\ken into two or more pieces."与字符串是相同的。"Long strings can be broken into two or more pieces."可以使用字符串串联的任何地方可能以前已使用后跟换行符的反斜杠长输入字符串的一行。若要强制在字符串中的新行,如下所示输入换行符转义序列 (\ n) 在点在要中止的行的字符串,例如:"E 阅读全文
posted @ 2014-02-26 16:09 landv 阅读(451) 评论(0) 推荐(0) 编辑