唯一通讯C++面试题

匿名网友 匿名网友 发布于: 2015-08-30 00:00:00
阅读 123 收藏 0 点赞 0 评论 0

1.
 输出什么?
 const char str1[] = “abc”;
 const char str2[] = “abc”;
 const char *p1 = “abc”;
 const char *p2 = “abc”;

 cout << (str1 == str2) << endl;
 cout << (p1 == p2) << endl;

2.
 输出什么?
 void Show(int num[])
 {
  cout << sizeof(num) << endl;
 }

3. 
 实现 strcpy()
 char *strcpy(char *strD, char *strS)

4.

 socket客户端和服务器的实现

5.
 0XFF换城十进制是多少

6.
 说出函数运行结果,并说明为什么
 void malloc(char *p)
 {
  p = (char *)malloc(100);
 }
 
 int main()
 {
  char *p = NULL;
  malloc(p);
  if (P != NULL)
  {
   cout << “ok” << endl;
  }
  else
  {
   cout << “error” << endl;
  }
 }

评论列表
文章目录