东芝笔试题目

时间:2020-12-07 10:37:49 笔试题目 我要投稿

东芝笔试题目

  笔试题目(一)

东芝笔试题目

  1. 将程序改成Unicode编程需要做哪些修改?

  window 2k以后的系统底层都是基于Unicode的,就算你调用ANSI的API(以A结尾比如SetWidowsTextA),系统也会在你的进程默认堆上动态分配一块内存,存放转换后的Unicode字符串,然后把转换后的字符串传递给API,如果调用了返回值为ANSI字符串的API,Windows会在后台进行相反的转换。

  其实VC中进行Unicode编程也不麻烦,大概如下:

  1.为工程添加UNICODE和_UNICODE预处理选项,在VC.net中就是 项目 -> 属性 -> c/c++ -> 预处理器 在"预处理定义"中加入这两个宏定义(vc6中 project -> settings -> c/c++ -> general 中的 Preprocessor definitions).

  2.Include (一般在stdafx.h中)然后把所有使用char*定义变量的地方换为LPTSTR/TCHAR*或LPCTSTR/const TCHAR*(对应于const char*).

  3.把所有的字符串常量用_T()宏包起来,比如 TCHAR* szText = _T("我的Text");

  4.所有的C库字符串操作函数也做相应的替换,比如

  strlen ->_tcslen

  strcat ->_tcscat

  strcmp ->_tcscmp

  ......

  注意,这些函数中的"文本长度"均为字符个数,而非char个数具体参看MSDN.

  5.API调用一般不用做特殊处理,当定义了UNICODE和_UNICODE后,所有的API都会被宏指向W结尾的版本(不定义则指向A结尾的`版本).

  其实,上面所说的并非强制你使用UNICODE,如果你还想回去使用ANSI,没有问题,把第一步定义的两个宏拿掉就OK了,继续我们的ANSI编程。

  2. TCHAR同char的区别

  TCHAR 就是当你的字符设置为什么就是什么

  例如:程序编译为 ANSI, TCHAR 就是相当于 CHAR

  当程序编译为 UNICODE, TCHAR 就相当于 WCHAR ,每个字符占两个字节

  3. BOOL同bool的区别

  意义上没什么区别,但却是两种类型.

  bool应该是C语言里定义的,返回值为true和false(事实上就上1和0)

  而BOOL应该是MFC及SDK里定义返回值的.

  它的定义应该是:typedef int BOOL;(WINDEF.H中定义)

  也就是说它是int型的

  返回值是大写的TRUE 和FALSE

  定义如下:

  #define FALSE 0

  #define TRUE 1

  (AFX.H中如此定义)

  一个是布尔型,一个是整型.

  事实上整型如果取1和0就可以代替布尔型了.

  --博才网博才网

  笔试题目(二)

  1. :A tape manufacturer reduces the price of his heavy duty tape from Rs.30/- to Rs.28/- a reel and the price of a regular tape from Rs.24/- to Rs.23/- a reel . A computing centre normally spends Rs.1440/- a month for tapes and 3/4 of this is for heavy duty tapes. How much will they save a month under the new prices?

  Ans.Rs.87 132

  2. shl测评题:In a team of 12 persons, 1/3 are women and 2/3 are men. To obtain a team with 20% women how many men should be hired?

  Ans.8

  3. :The dimensions of a certain machine are 48″ X 30″ X 52″. If the size of the machine is increased proportionately until the sum of its dimensions equals 156″, what will be the increase in the shortest side?/

  Ans. 6″

  4. shl测评题:In a certain company, 20% of the men and 40% of the women attended the annual company picnic. If 35% of all the employees are man, what percent of all the employees went to the picnic?

  Ans.33% 21%

  5. :It cost a college Rs.0.70 a copy to produce a Programme for the homecoming football game. If Rs.15,000/- was received for advertisements in the programme, how many copies at Rs.0.50 a copy must be sold to make a profit of Rs.8000/- ?

  Ans. 35000

【东芝笔试题目】相关文章:

会计笔试题目07-03

EXCEL笔试题目06-12

美的笔试题目12-15

惠普笔试题目08-10

伊利笔试题目07-09

夏普笔试题目07-03

奥美笔试题目06-18

LG笔试最常考的笔试题目07-09

Intel笔试真题技术笔试题目06-27

营销岗位笔试题目10-01