64,666
社区成员
发帖
与我相关
我的任务
分享
#if <TRADITIONAL C HEADERS>
#include<string.h>
namespace std {
using ::size_t; using ::memchr; using ::memcmp;
using ::memcpy; using ::memmove; using ::memset;
using ::strcat; using ::strchr; using ::strcmp;
using ::strcoll; using ::strcpy; using ::strcspn;
using ::strerror; using ::strlen; using ::strncat;
using ::strncmp; using ::strncpy; using ::strpbrk;
using ::strrchr; using ::strspn; using ::strstr;
using ::strtok; using ::strxfrm;
}
#include <cstring>
#include <cstdio>
int main(int argc,char* argv[])
{
char buf[100];
strcpy(buf,"a");
printf("%s\n",buf);
return 0;
}
#pragma GCC system_header
#include <bits/c++config.h>
#include <string.h>
#ifndef _GLIBCXX_CSTRING
#define _GLIBCXX_CSTRING 1
// Get rid of those macros defined in <string.h> in lieu of real functions.
#undef memchr
#undef memcmp
#undef memcpy
#undef memmove
#undef memset
#undef strcat
#undef strchr
#undef strcmp
#undef strcoll
#undef strcpy
#undef strcspn
#undef strerror
#undef strlen
#undef strncat
#undef strncmp
#undef strncpy
#undef strpbrk
#undef strrchr
#undef strspn
#undef strstr
#undef strtok
#undef strxfrm
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::memchr;
using ::memcmp;
using ::memcpy;
using ::memmove;
using ::memset;
using ::strcat;
using ::strcmp;
using ::strcoll;
using ::strcpy;
using ::strcspn;
using ::strerror;
using ::strlen;
using ::strncat;
using ::strncmp;
using ::strncpy;
using ::strspn;
using ::strtok;
using ::strxfrm;
using ::strchr;
using ::strpbrk;
using ::strrchr;
using ::strstr;
#ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
inline void*
memchr(void* __s, int __c, size_t __n)
{ return __builtin_memchr(__s, __c, __n); }
inline char*
strchr(char* __s, int __n)
{ return __builtin_strchr(__s, __n); }
inline char*
strpbrk(char* __s1, const char* __s2)
{ return __builtin_strpbrk(__s1, __s2); }
inline char*
strrchr(char* __s, int __n)
{ return __builtin_strrchr(__s, __n); }
inline char*
strstr(char* __s1, const char* __s2)
{ return __builtin_strstr(__s1, __s2); }
#endif
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif