【单选题】【消耗次数:1】
从一个文件中读一个字节存于char c; 正确的语句为( )
file.read(reinterpret_cast (&c), sizeof(c));
file.read(reinterpret_cast (&c), sizeof(c));
file.read(const char *)(&c), sizeof(c));
file.read((char *)c,sizeof(c);
参考答案:
复制
纠错
相关题目
【单选题】 从一个文件中读一个字节存于char c; 正确的语句为( )
①  file.read(reinterpret_cast const char * c), sizeof(c));
②  file.read(reinterpret_cast char * c), sizeof(c));
③  file.read(const char *)(c), sizeof(c));
④  file.read((char *)c,sizeof(c);
【单选题】 要从文件file.dat中读出第10个字节到变量c中,下列哪个方法适合? ( )
①  FileInputStream in=new FileInputStream(file.dat); in.skip(9); int c=in.read();
②  FileInputStream in=new FileInputStream(file.dat); in.skip(10); int c=in.read();
③  FileInputStream in=new FileInputStream(file.dat); int c=in.read();
④  RandomAccessFile in=new RandomAccessFile(file.dat); in.skip(9); int c=in.readByte();
【单选题】 若有说明语句:char c=‘\64’;则变量C包含:
①  1个字符
②  2个字符
③  3个字符
④  说明不合法,C值不确定
【判断题】 在C语言中,_file是一个合法的标识符。
①  正确
②  错误
【单选题】 设有定义:char a;int b;float c,double d;执行语句:c=a+b+c+d;后,变量c 的数据类()。
①  int
②  char
③  float
④  double
【单选题】 若有语句char c1=`d`,c2=`g`;printf(“%c,%d\n”,c2-`a`,c2-c1);则输出结果为:()(a的ASCII码值为97)
①  M、2
②  G、3
③  G、2
④  D、g
【简答题】 下面程序段的运行结果是[填空1]。char c[5]={a,b,\0,c,\0};printf(%s,c);
【判断题】 char[] chrArray={ a, b, c, d, e, f, g};char chr=chrArray[6];
①  正确
②  错误
【单选题】 当前目录是/usr/meng,其下属文件prog/file.c的绝对路径名是( )。
①  /usr/meng/file.c
②  /usr/file.c
③  /prog/file.c
④  /usr/meng/prog/file.c
【单选题】 当前目录是/usr/meng,其下属文件prog/file.c的绝对路径名是()。
①  /usr/meng/file.c
②  /usr/file.c
③  /prog/file.c
④  /usr/meng/prog/file.c
随机题目
【单选题】 Even if his letter ____ tomorrow, it ____ too late to do anything.
①  will arrive...is
②  should arrive...were
③  arrives...will be
④  arrives...would be
【单选题】 — The water changes into thick ice covering rivers and lakes in winter in Harbin. —_____ in Urumqi and children go skating on it then.
①  So is it
②  So it does
③  So it is
④  So does it
【单选题】 You’ ll have to____ your wrongdoing one day.
①  answer for
②  answer to
③  ask for
④  allow for
【单选题】 Classification is a useful ____ to the organization of knowledge in any field.
①  means
②  approach
③  mode
④  manner
【单选题】 We will be losing money this year unless that new economic plan of yours ____ miracle.
①  is working
②  works
③  will be working
④  worked
【单选题】 The population of the world ______ still _____ now.
①  will; grow
②  have; grown
③  is ; growing
④  is ; grown
【单选题】 Tomis______ careful,hardlymakesmistakes.
①  usually
②  never
③  always
④  sometimes
【单选题】 It takes a lot of ____ to put on a school play such as King Lear.
①  organization
②  arrangement
③  management
④  preparation
【单选题】 You are ____ to have had the help of such a man.
①  thoughtful
②  considerate
③  fortunate
④  moderate
【单选题】 Bread and butter ____ liked by Westerners.
①  is
②  are
③  were
④  be