2019最新成为HR专家的100门必修课全套课程
限时抢购仅需19元(原价3600元)
微软中国(Microsoft)

微软中国(Microsoft) 认领

计算机/互联网/通信/电子  北京   1000人以上  外企代表处

  1. 首页
  2. 公司
  3. 微软中国(Microsoft)
  4. 微软中国(Microsoft)软件工程师面试经验&面试问题

微软中国(Microsoft)面试经验

面试失败 北京 难度一般

微软中国(Microsoft)软件工程师面试经验&面试问题

应聘公司
微软中国(Microsoft)
面试职位
面试时间
2011-07-24 — 2011-07-24

面试问题

第三代所第三代所第三代的?

面试过程

NAME<br><br> strdup - duplicate a string<br><br>SYNOPSIS<br><br>STRDUP(P) STRDUP(P)<br><br>NAME<br><br> strdup - duplicate a string<br><br>SYNOPSIS<br><br> #include &lt;string.h&gt;<br><br> char *strdup(const char *s1);<br><br>DESCRIPTION<br><br> The strdup() function shall return a pointer to a new string, which is a duplicate of the string pointed to by s1.<br><br> The returned pointer can be passed to free(). A null pointer is returned if the new string cannot be created.<br><br>RETURN VALUE<br><br> The strdup() function shall return a pointer to a new string on success. Otherwise, it shall return a null pointer<br><br> and set errno to indicate the error.<br><br>ERRORS<br><br> The strdup() function may fail if:<br><br> ENOMEM Storage space available is insufficient.<br><br> The following sections are informative.<br><br>EXAMPLES<br><br> None.<br><br>strdup glibc 源代码<br><br>/* Duplicate S, returning an identical malloc'd string. */<br><br>char *<br><br>__strdup (const char *s)<br><br>{<br><br>size_t len = strlen (s) + 1;<br><br>void *new = malloc (len);<br><br>if (new == NULL)<br><br> return NULL;<br><br>return (char *) memcpy (new, s, len);<br><br>}<br><br>strndup glibc源码<br><br>char *<br><br>__strndup (s, n)<br><br> const char *s;<br><br> size_t n;<br><br>{<br><br>size_t len = __strnlen (s, n);<br><br>char *new = (char *) malloc (len + 1);<br><br>if (new == NULL)<br><br> return NULL;<br><br>new[len] = '';<br><br>return (char *) memcpy (new, s, len);<br><br>}

我要分享面试经验

正在加载验证码...

其它公司面试经验
微软中国(Microsoft)其它面试经验