随笔分类 - C/C++面试题
摘要:#include #include #include void f_sum(double* ,double*,double*); void i_sum(int *,int *,int *); void c_sum(char*,char*,char*); int main(int argc,char **argv) { int a=10; int b=5; double c=2.3; ...
阅读全文
摘要:1 #include 2 #include 3 char * fun1(char * p) 4 { 5 printf("%s\n",p); 6 return p; 7 } 8 char * fun2(char * p) 9 {10 printf("%s\n",p);11 return p;12...
阅读全文
摘要:c部分:::::::::::::::::::::::::::::::::::27、 关键字volatile有什么含意? 并给出三个不同的例子。【参考答案】一个定义为volatile的变量是说这变量可能会被意想不到地改变,这样,编译器就不会去假设这个变量的值了。精确地说就是,优化器在用到这个变量时必须...
阅读全文
摘要:#includevoid quick_sort(int a[],int left,int right){ int l = left; int r = right; int n = a[left]; if(left >= right) return; whi...
阅读全文
摘要:#include #include int main(){ int count = 1; char str[1024]; int i=0; int j =0; char ch='0'; while(ch != '\n') //输入一串英文 { ...
阅读全文
摘要:如程序:#include #include using namespace std;int main(){ int a[]={15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; int i,j; int len = sizeof(a)/sizeof(in...
阅读全文
摘要:#include #include using namespace std;int main(){ char str[1024]; cin>>str; int i = 0; while(str[i]!='\0') { ...
阅读全文
摘要:#include #include using namespace std;int mystrcmp(const char * str1,const char * str2){ int i=0; while(1) { if(str1[i]=='\0' &&str2[i]!='\0') ...
阅读全文
摘要:#include #include #include #include #include using namespace std;int main(){ char p[1024]; cin>>p; int len = strlen(p); int i,j; unsig...
阅读全文
摘要:1 #include 2 #include 3 #include 4 void getmemory(char *p) 5 { 6 p=(char *) malloc(100); 7 strcpy(p,"hello world"); 8 } 9 10 11 in...
阅读全文
摘要:#include #include using namespace std;void get_size(char str[100]){ cout<<"size in get_size "<<sizeof(str)<<endl; }int main(){ cha...
阅读全文

浙公网安备 33010602011771号