| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1160 人关注过本帖
标题:一些C++面试题求答案
只看楼主 加入收藏
战士
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
帖 子:147
专家分:0
注 册:2006-2-19
收藏
 问题点数:0 回复次数:3 
一些C++面试题求答案
char s[1000]="";
sizeof(s)=_;
strlen(s)=_;
strcpy(s,"abc");
sizeof(s)=_;
strlen(s)=_;
char s1[100]=s;
sizeof(s1)=;
strlen(s1)=_;
int i=-1;
unsiged j=i;
j=_;
Memorystate有什么作用?
下面的程序哪里有错误?
void  first()
{
 char *p=0;
 two(p);
}
void two(char *j)
{
 *j=2;
 }
int i=3;
int j=i<<3;
i=_;
j=_;
c++中怎么连接sql数据库?
先想到这么多,以后再想到再发。

[[it] 本帖最后由 战士 于 2008-6-4 09:30 编辑 [/it]]
搜索更多相关主题的帖子: char void 面试 two int 
2008-06-04 09:26
zzy840208
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-4-16
收藏
得分:0 
做了前面一些
char s[1000]="";
sizeof(s)=1000;//分配了1000个字节给s,一个字符占一个字节
strlen(s)=0;   //s中不存在任何字符,所以为0;

strcpy(s,"abc");
sizeof(s)=1000;//分配给s的空间没有变化,还是1000个字节
strlen(s)=3;   //赋了三个字符给它,所以它的长度为3个字节

char s1[100]=s;//不存在这样的初始化,可以改为:
               //char s1[100];
               //strcpy(s1,s);
sizeof(s1)=100;//分配了100个字节给s1
strlen(s1)=3;  //s1中有三个字符了
2008-06-04 12:44
六道
Rank: 1
等 级:新手上路
帖 子:120
专家分:0
注 册:2007-9-28
收藏
得分:0 
楼上正解~
连接AQL:ADO,DAO,ODBC

应该是指针初始化和作用域方面的问题

i=3
i为0000 0011左移3位0001 1000,所以j=24

[[it] 本帖最后由 六道 于 2008-6-4 17:02 编辑 [/it]]

★孤独的人是可耻的★
2008-06-04 16:50
六道
Rank: 1
等 级:新手上路
帖 子:120
专家分:0
注 册:2007-9-28
收藏
得分:0 
MEMORYSTATUS
This structure contains information about current memory availability. The GlobalMemoryStatus function uses this structure.
当前内存可用的一些信息。

typedef struct _MEMORYSTATUS {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORD dwTotalPhys;
DWORD dwAvailPhys;
DWORD dwTotalPageFile;
DWORD dwAvailPageFile;
DWORD dwTotalVirtual;
DWORD dwAvailVirtual;
} MEMORYSTATUS, *LPMEMORYSTATUS;
Members
dwLength
Specifies the size, in bytes, of the MEMORYSTATUS structure. Set this member to sizeof(MEMORYSTATUS) when passing it to the GlobalMemoryStatus function.
dwMemoryLoad
Specifies a number between 0 and 100 that gives a general idea of current memory utilization, in which 0 indicates no memory use and 100 indicates full memory use.
dwTotalPhys
Indicates the total number of bytes of physical memory.
dwAvailPhys
Indicates the number of bytes of physical memory available.
dwTotalPageFile
Indicates the total number of bytes that can be stored in the paging file. Note that this number does not represent the actual physical size of the paging file on disk.
dwAvailPageFile
Indicates the number of bytes available in the paging file.
dwTotalVirtual
Indicates the total number of bytes that can be described in the user mode portion of the virtual address space of the calling process.
dwAvailVirtual
Indicates the number of bytes of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling process.

[[it] 本帖最后由 六道 于 2008-6-4 16:56 编辑 [/it]]

★孤独的人是可耻的★
2008-06-04 16:55
快速回复:一些C++面试题求答案
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030975 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved