首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

趋势科技几道笔考题

2013-03-28 
趋势科技几道笔试题1. What is the output ofthe following program?#includeiostreamusing namespace s

趋势科技几道笔试题

1. What is the output of  the following program?

#include<iostream>using namespace std;void myalloc(char *x,int n){x=(char*)malloc(n*sizeof(char));memset(x,0,n*sizeof(char));}int main(){char *g="String";myalloc(g,20);strcpy(g,"Oldstring");printf("The string is %s",g);}

a) The string is :String

b)Run time error/Core dump

c)The string is :Oldstring 

d)Sysntax error during complication

3) None of these

热点排行