C++学习过程中的点点滴滴

C++编程过程中常见问题及错误

常用链接

统计

联想5G免费网络硬盘

最新评论

2009年5月20日 #

C++中字符串的转换

     摘要: 本文介绍了C++中已经定义的用于与字符串相关的类型转换的函数的用法及其实例。  阅读全文

posted @ 2009-05-20 21:34 何靖 阅读(410) | 评论 (0)编辑 收藏

2009年2月25日 #

如何理解C/C++中的复杂声明

理解复杂声明可用的“右左法则”:
从变量名看起,先往右,再往左,碰到一个圆括号就调转阅读的方向;括号内分析完就跳出括号,还是按先右后左的顺序,如此循环,直到整个声明分析完。

举例:
int   (*func)(int   *p);
首先找到变量名func,外面有一对圆括号,而且左边是一个*号,这说明func是一个指针;然后跳出这个圆括号,先看右边,又遇到圆括号,这说明(*func)是一个函数,所以func是一个指向这类函数的指针,即函数指针,这类函数具有int*类型的形参,返回值类型是int。

int   (*func[5])(int   *);
func右边是一个[]运算符,说明func是具有5个元素的数组;func的左边有一个*,说明func的元素是指针(注意这里的*不是修饰func,而是修饰func[5]的,原因是[]运算符优先级比*高,func先跟[]结合)。跳出这个括号,看右边,又遇到圆括号,说明func数组的元素是函数类型的指针,它指向的函数具有int*类型的形参,返回值类型为int。

也可以记住2个模式:
type   (*)(....)函数指针  
type   (*)[]数组指针  

注:转载自网络,如有不对,请指正!

posted @ 2009-02-25 15:21 何靖 阅读(295) | 评论 (0)编辑 收藏

2008年9月27日 #

C++类型转换符的使用

     摘要: 本文归纳了C++中四种比C语言中更安全,更优雅的类型转换运算符(函数)的用法.  阅读全文

posted @ 2008-09-27 16:59 何靖 阅读(2362) | 评论 (3)编辑 收藏

2008年9月10日 #

如何在程序运行过程中动态加载不同菜单

     摘要: 本文介绍了在程序运行过程 中使用自定义消息来实现动态加载菜单的方法。并详细地介绍了自定义消息的使用。  阅读全文

posted @ 2008-09-10 12:31 何靖 阅读(1560) | 评论 (7)编辑 收藏

2008年8月24日 #

在winsock编程过程中遇到的socket错误代码----从网上收集,非本人总结

出现网络联机错误Socket error #11001

表示您的计算机无法连上服务器,请检查您的Proxy设定以及Proxy相关账号,或暂时取消您防毒软件的「个人防火墙」。

·  出现网络联机错误Socket error #11004

应该是网络联机状态问题,请用户检查网络联机是否正常。

·  出现网络联机错误Socket error #10060 Connection Timed Out

表示您与服务器发生联机逾时错误,请检查您的Proxy相关设定,以及Proxy Server是否已将SSL 443 port打开。

·  出现网络联机错误Socket error #10061

表示服务器忙碌中无法与您建立联机,请稍后再试。

·  出现网络联机错误Socket error #10022

请您上网更新Windows操作系统组件。Windows NT version 4.0的用户请下载安装 Service Pack 5(含)以上。

·  出现Internal Server Error

主机忙碌中,请您稍后再试。

·  上传时出现Socket error #10022 Invalid argument.

请上网更新Windows操作系统组件(windows update)。Windows NT version 4.0的用户请下载安装 Service Pack 5(含)以上。

·  上传时出现socket error #10054 Connection reset by peer

原因为连接被防火樯或proxy中断"或因为您有安装ip分享器请将ip分享器先拿掉,直接将计算机接adsl的线路后重新上传。

·  上传时出现socket error #10057 Connection reset by peer

原因为系统文件被破坏,请进行系统的杀毒,关闭杀毒软件、防火墙。


INDY9开发程序中反馈的Socket Errors

下面是Socket Error的错误码和描述:

Socket error 0 - Directly send error

Socket error 10004 - Interrupted function call

Socket error 10013 - Permission denied

Socket error 10014 - Bad address

Socket error 10022 - Invalid argument

Socket error 10024 - Too many open files

Socket error 10035 - Resource temporarily unavailable

Socket error 10036 - Operation now in progress

Socket error 10037 - Operation already in progress

Socket error 10038 - Socket operation on non-socket

Socket error 10039 - Destination address required

Socket error 10040 - Message too long

Socket error 10041 - Protocol wrong type for socket

Socket error 10042 - Bad protocol option

Socket error 10043 - Protocol not supported

Socket error 10044 - Socket type not supported

Socket error 10045 - Operation not supported

Socket error 10046 - Protocol family not supported

Socket error 10047 - Address family not supported by protocol family

Socket error 10048 - Address already in use

Socket error 10049 - Cannot assign requested address

Socket error 10050 - Network is down

Socket error 10051 - Network is unreachable

Socket error 10052 - Network dropped connection on reset

Socket error 10053 - Software caused connection abort

Socket error 10054 - Connection reset by peer

Socket error 10055 - No buffer space available

Socket error 10056 - Socket is already connected

Socket error 10057 - Socket is not connected

Socket error 10058 - Cannot send after socket shutdown

Socket error 10060 - Connection timed out

Socket error 10061 - Connection refused

Socket error 10064 - Host is down

Socket error 10065 - No route to host

Socket error 10067 - Too many processes

Socket error 10091 - Network subsystem is unavailable

Socket error 10092 - WINSOCK.DLL version out of range

Socket error 10093 - Successful WSAStartup not yet performed

Socket error 10094 - Graceful shutdown in progress

Socket error 11001 - Host not found

Socket error 11002 - Non-authoritative host not found

Socket error 11003 - This is a non-recoverable error

Socket error 11004 - Valid name, no data record of requested type

 

WSAEADDRINUSE (10048) Address already in use

WSAECONNABORTED (10053) Software caused connection abort

WSAECONNREFUSED (10061) Connection refused

WSAECONNRESET (10054) Connection reset by peer

WSAEDESTADDRREQ (10039) Destination address required

WSAEHOSTUNREACH (10065) No route to host

WSAEMFILE (10024) Too many open files

WSAENETDOWN (10050) Network is down

WSAENETRESET (10052) Network dropped connection

WSAENOBUFS (10055) No buffer space available

WSAENETUNREACH (10051) Network is unreachable

WSAETIMEDOUT (10060) Connection timed out

WSAHOST_NOT_FOUND (11001) Host not found

WSASYSNOTREADY (10091) Network sub-system is unavailable

WSANOTINITIALISED (10093) WSAStartup() not performed

WSANO_DATA (11004) Valid name, no data of that type

WSANO_RECOVERY (11003) Non-recoverable query error

WSATRY_AGAIN (11002) Non-authoritative host found

WSAVERNOTSUPPORTED (10092) Wrong WinSock DLL version 
 

在命令提示符下输入:net helpmsg 1xxxx

就能够得到Windows系统提供的错误提示的详细解释。

posted @ 2008-08-24 13:09 何靖 阅读(1804) | 评论 (0)编辑 收藏

仅列出标题