📄 subject_45893.htm
字号:
<p>
序号:45893 发表者:风雪飘 发表日期:2003-07-04 17:10:25
<br>主题:Help一段c++的出错,求能人修改 高人请进!!1
<br>内容:#include <stdio.h><BR>#include <stdlib.h><BR>#include <string.h><BR>#include <string><BR>#include <iostream><BR>#include <exception><BR>#include <sqlplus.hh><BR>#include <custom.hh><BR>#include <mysql++><BR>#include <cgicc/Cgicc.h><BR>#include <SNCLIB/SNCLIB.H><BR>#include "pic.h"<BR>#include "clnt_rpcdb.h"<BR>#include "basiclib.h"<BR>#include "smstools.h"<BR>#include "dbtypes.h"<BR>#include "public_func.h"<BR>#include "db_mysql.h"<BR><BR>using namespace std;<BR><BR>/******************<BR>上行处理程序的例子:手机用户13910521819发送JY到8888(新浪短信),参加金庸问答游戏,<BR>这时网关上行daemon调用上行处理程序的命令行为:<BR><BR>/data0/smsgw/bin/recv/moproc 13910521819 "JY JF" 101001<BR><BR>共有四个命令行参数,其中:<BR>argv[0]: /data0/smsgw/bin/recv/moproc: 上行处理程序的路径<BR>argv[1]: 13910521819: 发送上行请求的用户的手机号码<BR>argv[2]: JY JF: 用户发送的上行信息<BR>argv[3]: 101001: 处理用户上行请求的网关代号<BR>******************/<BR><BR>//以下定义上行代码<BR><BR><BR>#define MO_GP_CODE "XA"<BR><BR>#define IOD_ALERT_SERVICE 110000 //上行编号<BR>#define IOD_GAME_SERVICE 100000 //上行编号<BR><BR><BR><BR>bool sendnum(char *, int);<BR><BR>int main (int argc, char *argv[])<BR>{<BR> char code[128], msg[1024], number[64];<BR><BR> if(argc < 3)<BR> { <BR> return 1;<BR> }<BR> char *sender = argv[1];<BR><BR> sprintf(code,argv[2]);<BR><BR> char *p = code;<BR> while (*p = ' ')<BR> {<BR> p++;<BR> }<BR><BR> sprintf(number, p);<BR><BR> int xanum = 0;<BR> char buff[64];<BR> sprintf(buff, number);<BR><BR> <BR> while (strlen(buff) > 1)<BR> {<BR> xanum =0;<BR> for (int i = 0; buff[i] != '\0'; i++)<BR> { <BR> sprintf(msg, "您好,请输入性爱的缩写XA,如XA 1回复可以得到相关的第一条经验。");<BR> SmsSendMsg(sender, IOD_ALERT_SERVICE, sender, msg, NULL, 0, IOD);//发短信<BR> return 1;<BR> <BR> xanum += buff[i] ;<BR> }<BR> sprintf(buff, "%d", xanum);<BR> }<BR><BR> send_num(sender, xanum);<BR> return 1;<BR>}<BR><BR><BR><BR>bool send_num(char *sender, int num)<BR>{<BR> char msg[1024];<BR> switch (num)<BR> {<BR> case 1:<BR> {<BR> sprintf(msg, "您所选的数字是1。");<BR> SmsSendMsg(sender, IOD_GAME_SERVICE, sender, msg, NULL, 0, IOD);<BR> break;<BR> }<BR> case 2:<BR> {<BR> sprintf(msg, "您所选的数字是2。");<BR> SmsSendMsg(sender, IOD_GAME_SERVICE, sender, msg, NULL, 0, IOD);<BR> break;<BR> }<BR> return true;<BR> }
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:super_xxx_xxx 回复日期:2003-07-07 09:53:34
<br>内容:什么问题?出什么错?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:风雪飘 回复日期:2003-07-07 12:46:09
<br>内容:在UNIX上出错<BR>在VC上运行正常<BR>此程序是短信预定程序
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -