study c(vc中测试过)——基本变量,宏定义
来源:互联网 发布:string转json数组格式 编辑:程序博客网 时间:2024/05/30 05:42
#include "stdafx.h"
#include <stdio.h>
extern void main_fileoper22();
int main(int argv,char* arg[]){
//命令行参数
while(argv-->0){
printf("%d=%s/n",argv,*arg++);
}
printf("start main....../n");
main_fileoper22();
return 0;
}
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
/*数据类型长度,字符变量*/
int main_size()
{
int a = 0;
short b = 1;
short int c = 2;
int size = sizeof(a);
int size2 = sizeof(b);
printf("%d,%d/n",size,size2);
char ch1 = getchar();
putchar(ch1);
scanf("%d",&a);
printf("---%ld---",a);
return 0;
}
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
/*数据类型,输入输出*/
double globalvar;
int main_basicvar(){
float a,b,c;
double s,area;
printf("%f,%f",a,globalvar);
scanf("%f %f %f",&a,&b,&c);
s = (a+b+c)/2.0;
area = sqrt(s*(s-a)*(s-b)*(s-c));
printf("%f",area);
return 0;
}
#include "stdafx.h"
#include <math.h>
#define SQUARE x*x*x
#if !defined(SQUARE)
#define SQUARE x*x
#else
#define SQUARE x*x*x*x
#endif
#define ARRAY char*
typedef char* ARRAY2;
/*预处理:宏定义,类型定义,文件包含,条件编译*/
int main_define(){
int x = 2;
printf("start....../n");
int a = 2*SQUARE;
printf("%d/n",a);
ARRAY array1,array2;
array1 = "ssss";
array2='d';
ARRAY2 array11,array22;
array11="wwww1";
array22="wwww2";
puts(array11);puts(array22);
return 0;
}
- study c(vc中测试过)——基本变量,宏定义
- study c(vc中测试过)——数组和函数,变量范围
- study c(vc中测试过)——指针
- study c(vc中测试过)——结构体,链表,内存分配,位操作
- study c(vc中测试过)——指针复习,文件操作
- VC++学习笔记(9)——在VC中定义外部变量
- c中变量定义问题
- VC中定义变量名的陷阱
- C++——变量的声明、定义
- Daily-C-Study(15):C语言宏定义#define
- ns2中基本变量类型定义
- iOS中C中变量的定义
- C/C++中变量类型最值之宏定义
- C/C++中宏定义和常变量的区别
- C语言好难——在头文件中定义const变量
- c语言在switch中定义变量
- C中变量的定义?声明?
- c语言中枚举类型变量定义
- Java读取Properties文件的六种方法
- 多线程编程(5) - 从 CreateThread 说起[续三]
- 用@Resource和@Autowired注解完成属性装配
- grep
- JFileChooser多选、选择目录
- study c(vc中测试过)——基本变量,宏定义
- Java_JDBC 数据库连接接口
- ==和equals
- study c(vc中测试过)——数组和函数,变量范围
- study c(vc中测试过)——指针
- GTK安装步骤
- study c(vc中测试过)——结构体,链表,内存分配,位操作
- ORACLE_SEQUENCE建立
- study c(vc中测试过)——指针复习,文件操作