删除目录及目录下的文件(user ShellApi单元)function SHMyDelDirectory(const Source: string): boolean; var fo: TSHFILEOPSTRUCT; begin FillChar(fo, SizeOf(fo), 0); with...
分类:
其他好文 时间:
2015-06-30 01:21:32
阅读次数:
136
1.试验代码:#include #include #include int main(int argc, char *argv[]){ QApplication app(argc, argv); int size = sizeof(QObject); QPushButton* quit = new ...
分类:
其他好文 时间:
2015-06-29 13:07:56
阅读次数:
168
以下程序的输出结果
#include
void main()
{
char * ptr="hello";
char str[]="hello";
printf("sizeof(pts) is %d\n", sizeof(ptr));//这里输出指针的大小
printf("sizeof(str) is %d\n", sizeof(str));//这里输出整个st...
分类:
编程语言 时间:
2015-06-29 10:00:44
阅读次数:
133
21.用C++写个程序,如何判断一个操作系统是16位还是32位的?
【标准答案】定义一个指针p,打印出sizeof(p),如果节果是4,则表示该操作系统是32位,打印结果是2,表示是16位。
22.用C++写个程序,如何判断一个操作系统是16位还是32位的?不能用sizeof()函数。
【参考答案】
int a = ~0;
if( a>65536 )
{
cout<<"32...
分类:
编程语言 时间:
2015-06-27 16:48:09
阅读次数:
160
序第三次C/C++专项,嗯,要抗住打击,继续加油~错题分析与总结1 . 在64位系统中,有如下类:class A
{
public:
void *p1;
private:
void *p2;
protected:
void *p3;
};
class B: public A {};那么sizeof(B)的数值是?A . 8
B . 16
C . 24
D . 32分...
分类:
编程语言 时间:
2015-06-27 16:42:33
阅读次数:
174
转自 http://blog.csdn.net/todd911/article/details/8892578[cpp]view plaincopy#includeintmain(void){inta[2][3];printf("%p\n",a);printf("%d\n",sizeof(a));....
分类:
编程语言 时间:
2015-06-27 16:14:24
阅读次数:
118
本文主要记录了 sizeof 操作符 和 strlen() 函数的区别,以及各自的用途。(在下才疏学浅,发现错误,还请留言指正)sizeof 和 strlen 的区别示例代码如下:#includeint main(){ char str[20]="0123456789"; printf(...
分类:
其他好文 时间:
2015-06-27 16:10:40
阅读次数:
87
事例1(转)在程序中多次用的strcat函数,但是有时候编译通过,但是执行时却出现了错误。为了进一步了解strcat函数的使用,我首先写了这样的一个测试程序:main(){ char *Temp=(char *)malloc(sizeof(char)*200); Temp="strcat"; cha...
分类:
其他好文 时间:
2015-06-27 16:05:18
阅读次数:
130
主要功能的实现:
#include "SeqList.h"
void InitSeqList(SeqList * pSeq)//初始化
{
assert(pSeq);
pSeq->array = (DataType*)malloc(sizeof(DataType)*DEFAULT_CAPICITY);
pSeq->size = 0;
pSeq->capicity = DEFAULT_CA...
分类:
编程语言 时间:
2015-06-26 18:11:06
阅读次数:
136
sizeof()功能:计算数据空间的字节数 1.与strlen()比较 strlen()计算字符数组的字符数,以"\0"为结束判断,不计算为'\0'的数组元素。 而sizeof计算数据(包括数组、变量、类型、结构体等)所占内存空间,用字节数表示。 2.指针与静态数组的sizeof操作 指针均可...
分类:
其他好文 时间:
2015-06-25 21:13:11
阅读次数:
118