? 12个C语言面试题,涉及指针、进程、运算、结构体、函数、内存,看看你能做出几个! 1.gets()函数 问:请找出下面代码里的问题: #include<stdio.h> int main(void) { ??? char buff[10]; ??? memset(buf...
分类:
编程语言 时间:
2015-06-30 13:18:57
阅读次数:
150
1.gets()函数问:请找出下面代码里的问题:#includeint main(void){ char buff[10]; memset(buff,0,sizeof(buff)); gets(buff); printf("\n The buffer entered is [%s]\n",buff)...
分类:
编程语言 时间:
2015-06-30 12:11:57
阅读次数:
145
#include #include #include // for memset#include using namespace std;int main(){ int ce[26], co[26]; string encrypted, orginal; string::size_type i, ....
分类:
其他好文 时间:
2015-06-27 15:57:06
阅读次数:
106
题意:给一个数n,返回小于n的素数个数。思路: 1 class Solution { 2 public: 3 int countPrimes(int n) { 4 bool* isPrime =new bool[n] ; 5 6 memset...
分类:
其他好文 时间:
2015-06-26 22:19:55
阅读次数:
123
memset是计算机中C/C++语言函数。将s所指向的某一块内存中的前n个 字节的内容全部设置为ch指定的ASCII值,
块的大小由第三个参数指定,这个函数通常为新申请的内存做初始化工作, 其返回值为指向s的指针。
void *memset(void *s, int ch, size_t n);
函数解释:将s中前n个字节 (typedef unsigned int size_t )用 ...
分类:
其他好文 时间:
2015-06-25 09:04:32
阅读次数:
151
算法模板//Author LJH//www.cnblogs.com/tenlee#include #include #include #include #include #include #include #include #include #define clc(a, b) memset(a, b...
分类:
编程语言 时间:
2015-06-22 19:12:22
阅读次数:
139
#include
using namespace std;
const int maxN=10024;
int n,vis[maxN],a[maxN];
bool find()
{
memset(vis,-1,sizeof(vis));
for(int i=0;i<n;++i){
for(int j=0;j=0...
分类:
其他好文 时间:
2015-06-22 17:56:53
阅读次数:
110
一、sprintf的用法
// 将字符串存入arr数组
sprintf(arr, "%s", "abc");
// 将整数转换为字符串存入arr数组
sprintf(arr, "%d", 123);
二、atoi的用法
// 将字符串转换为整数
a = atoi("1243");
三、strlen的用法
1、strlen 字符串的结...
分类:
其他好文 时间:
2015-06-21 02:08:23
阅读次数:
131
#include #include int main(){ int T, N, i, j; int a[10]; scanf("%d", &T); while (T--) { memset(a, 0, sizeof(a)); scanf("%d", &N); for (i = 1; i 0)...
分类:
其他好文 时间:
2015-06-21 00:47:44
阅读次数:
153
#include #include extern "C" __declspec(dllexport)int TCharParm(char* in,int len,char* out){ memset(out,0,4); memcpy(out,in,len); return 0;}extern "C"...