#include
#include
using namespace std;
class xiaok{
public:
int k;
int a;
void han(){cout<<k<<a<<endl;}
};
int main(int argc, char const *argv[])
{
xiaok *p=(xiaok*)malloc(sizeof(xiaok));
new(...
分类:
其他好文 时间:
2015-06-03 21:37:01
阅读次数:
211
1 #include 2 #include 3 4 int main(int argc, char** argv) 5 { 6 int i; 7 int a[10]; 8 for (i = 0; i < 9; i++) 9 a[i] = i;10 11 for (i ...
分类:
其他好文 时间:
2015-06-03 19:19:37
阅读次数:
144
#import typedef int MyInt;typedef int (^MyBlock)(int, int);void play(){ NSLog(@"play mp3");}int main(int argc, const char * argv[]){ @autoreleas...
分类:
其他好文 时间:
2015-06-03 17:12:31
阅读次数:
97
#include "stdafx.h"
#include
#include int main(int argc, char* argv[])
{ double a = 77.001;
double b = ceil(a); printf("b = %.3f\n",b); double c = 77.999;
double d =...
分类:
其他好文 时间:
2015-06-03 11:51:15
阅读次数:
205
设计模式分为三类:创建模式,结构模式,行为模式。共有26中模式 单例模式 1.main函数 #import <Foundation/Foundation.h> #import "Theme.h" int main(int argc, const char * argv[]) { ??? @autoreleasepo...
分类:
其他好文 时间:
2015-06-03 01:03:18
阅读次数:
109
求100—200之间的全部素数#import int main(int argc, const char * argv[]) { @autoreleasepool { int i,j,s; for (i=100;i<200;i++) { for (j=2;j<i;j++)...
分类:
其他好文 时间:
2015-06-02 14:44:44
阅读次数:
121
求100---999之间的所有水仙花数,并输出。提示:水仙花数是一个3位数的自然数,该数各位数的立方和等于该数本身例如:153=1^3+5^3+3^3,所以153为水仙花数#import int main(int argc, const char * argv[]) { @autoreleasepo...
分类:
其他好文 时间:
2015-06-02 14:43:29
阅读次数:
479
Pipeline 与 xargsPipeline与命令行参数应用程序接收输入的两种方式:
命令行参数
输入字符串被当成参数,通过int main(int argc, char **argv), 中的argv传入。或使用下面API获取,再自己分析:LPTSTR WINAPI GetCommandLine(void);
Pipeline
指示输入内容存放在标准输入上,标准输入可以理解成一个文件,一般...
分类:
其他好文 时间:
2015-06-02 11:15:45
阅读次数:
95
管道通信属于进程间通信的一种方式,使用方便,但是局限是父进程与子进程间的通信,下面是调试好的代码。程序父进程创建2个管道,分别用于父进程写数据--子进程读数据和子进程写数据--父进程读数据:#include #include #include #include int main(int argc,c...
分类:
系统相关 时间:
2015-06-02 11:07:29
阅读次数:
123
典型的 boost program_options的用法如下:#include using namespace boost::program_options;using namespace std;int main(int argc, char* argv[]) // 需要命令行参数{ int .....
分类:
其他好文 时间:
2015-05-31 16:37:02
阅读次数:
127