﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-小人物</title><link>http://www.cppblog.com/junshi66/</link><description>精益求精</description><language>zh-cn</language><lastBuildDate>Wed, 08 Apr 2026 07:37:27 GMT</lastBuildDate><pubDate>Wed, 08 Apr 2026 07:37:27 GMT</pubDate><ttl>60</ttl><item><title>思考了一点点指针和地址的关系</title><link>http://www.cppblog.com/junshi66/archive/2009/10/21/99122.html</link><dc:creator>军</dc:creator><author>军</author><pubDate>Wed, 21 Oct 2009 08:59:00 GMT</pubDate><guid>http://www.cppblog.com/junshi66/archive/2009/10/21/99122.html</guid><wfw:comment>http://www.cppblog.com/junshi66/comments/99122.html</wfw:comment><comments>http://www.cppblog.com/junshi66/archive/2009/10/21/99122.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/junshi66/comments/commentRss/99122.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/junshi66/services/trackbacks/99122.html</trackback:ping><description><![CDATA[#include&lt;iostream.h&gt;<br>#include&lt;string.h&gt;<br>void main()<br>{<br>&nbsp;char tt[]={'t','e','f'};<br>&nbsp;int f=10; <br>&nbsp;/*cout&lt;&lt;strlen(tt)&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;&amp;tt&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;&amp;tt+1&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;sizeof(((&amp;tt+1)-&amp;tt))&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;sizeof(int)&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;sizeof(char)&lt;&lt;endl;<br>&nbsp;for(int i=0;i&lt;strlen(tt);i++)<br>&nbsp;&nbsp; cout&lt;&lt;&amp;tt[i]&lt;&lt;"\n";<br>&nbsp;&nbsp;&nbsp; cout&lt;&lt;endl;<br>&nbsp;&nbsp;&nbsp; for(char i=0;i&lt;strlen(tt);i++)<br>&nbsp;&nbsp; cout&lt;&lt;(&amp;tt)+i&lt;&lt;" "&lt;&lt;*((&amp;tt)+i)&lt;&lt;endl;<br>&nbsp;&nbsp;&nbsp; cout&lt;&lt;endl; */<br>&nbsp;char *p;<br>&nbsp;cout&lt;&lt;"未进行指向前指针p的地址："&lt;&lt;&amp;p&lt;&lt;endl; <br>&nbsp;int *x;<br>&nbsp;cout&lt;&lt;"未进行指向前指针x的地址："&lt;&lt;&amp;x&lt;&lt;endl; <br>&nbsp;x=&amp;f;<br>&nbsp;p=tt;&nbsp; //将tt中的内容复制到p的内容中去 ，而不是将tt的地址复制到p的内容中去(应该是一种其他的映射机制而不是复制----这样太浪费计算机的速度) <br>&nbsp;cout&lt;&lt;"字符串的地址："&lt;&lt;&amp;tt&lt;&lt;endl; //显示的字符串的地址 <br>&nbsp;cout&lt;&lt;"进行指向后指针p的地址："&lt;&lt;&amp;p&lt;&lt;endl; <br>&nbsp;cout&lt;&lt;"显示指针p的内容："&lt;&lt;p&lt;&lt;endl; //显示的是这个指针指向的内容 <br>&nbsp;cout&lt;&lt;"指针x的内容："&lt;&lt;x&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;"f的地址："&lt;&lt;&amp;f&lt;&lt;endl; //显示f的地址 <br>&nbsp;cout&lt;&lt;"进行指向后指针x的地址："&lt;&lt;&amp;x&lt;&lt;endl;// 显示指针x的地址&nbsp; 通过这个可以说明指针在没有被指向的时候是有地址的 <br>&nbsp;p[0]='q'; <br>&nbsp;cout&lt;&lt;&amp;p&lt;&lt;endl; <br>&nbsp;cout&lt;&lt;*p&lt;&lt;endl;<br>}//通过这个例子知道指针在声明的时候就有一个地址；<br>&nbsp;//指针指向的必须是地址（这个是根据指针前面的类型符号来判断的--好像是） <br>&nbsp;//指针的"内容"就是指向的值，比如 x指针的内容就是f的内容；这样做的目的是为了减少建立临时变量的麻烦 1 指针===矢量 
<img src ="http://www.cppblog.com/junshi66/aggbug/99122.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/junshi66/" target="_blank">军</a> 2009-10-21 16:59 <a href="http://www.cppblog.com/junshi66/archive/2009/10/21/99122.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>练习字符串的读写（终于要开始练习了希望每天坚持）</title><link>http://www.cppblog.com/junshi66/archive/2009/10/20/99030.html</link><dc:creator>军</dc:creator><author>军</author><pubDate>Tue, 20 Oct 2009 06:00:00 GMT</pubDate><guid>http://www.cppblog.com/junshi66/archive/2009/10/20/99030.html</guid><wfw:comment>http://www.cppblog.com/junshi66/comments/99030.html</wfw:comment><comments>http://www.cppblog.com/junshi66/archive/2009/10/20/99030.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/junshi66/comments/commentRss/99030.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/junshi66/services/trackbacks/99030.html</trackback:ping><description><![CDATA[#include&lt;iostream.h&gt;<br>void main()<br>{<br>&nbsp;char t[]={"china"};<br>&nbsp;cout&lt;&lt;"我们国家的名字："&lt;&lt;t&lt;&lt;endl;<br>&nbsp;int length=10;<br>&nbsp;for(int i=0;i&lt;6;i++)<br>&nbsp;{<br>&nbsp;&nbsp;cout&lt;&lt;t[i]&lt;&lt;" ";<br>&nbsp;}<br>&nbsp;cout&lt;&lt;endl;<br>&nbsp;for(int i=0;i&lt;6;i++)<br>&nbsp;{<br>&nbsp;&nbsp;cout&lt;&lt;&amp;t[i]&lt;&lt;"\n"; <br>&nbsp;}<br>&nbsp;cout&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;"该字符串的长度是:"&lt;&lt;sizeof(t)/sizeof(char)&lt;&lt;endl;<br>&nbsp;int s=100;<br>&nbsp;cout&lt;&lt;"s的值是："&lt;&lt;s&lt;&lt;endl;<br>&nbsp;cout&lt;&lt;"s的地址是:"&lt;&lt;&amp;s&lt;&lt;endl;<br>&nbsp;//cout&lt;&lt;"t的地址是:"&lt;&lt;&amp;t[0]&lt;&lt;endl;//存在一个问题：就是在这里使用&amp;t[0]输出地址的时候输出的是整个字符串，而不是地址？？好奇怪<br>&nbsp;&nbsp; cout&lt;&lt;"t的地址是:"&lt;&lt;&amp;t&lt;&lt;endl;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //疑惑的第二个地方：怎么使用&amp;输出每个元素的地址呢？？&nbsp;<br>} 
<img src ="http://www.cppblog.com/junshi66/aggbug/99030.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/junshi66/" target="_blank">军</a> 2009-10-20 14:00 <a href="http://www.cppblog.com/junshi66/archive/2009/10/20/99030.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asp 中 使用sql server 建立数据库的应用</title><link>http://www.cppblog.com/junshi66/archive/2009/10/20/99019.html</link><dc:creator>军</dc:creator><author>军</author><pubDate>Tue, 20 Oct 2009 04:03:00 GMT</pubDate><guid>http://www.cppblog.com/junshi66/archive/2009/10/20/99019.html</guid><wfw:comment>http://www.cppblog.com/junshi66/comments/99019.html</wfw:comment><comments>http://www.cppblog.com/junshi66/archive/2009/10/20/99019.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/junshi66/comments/commentRss/99019.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/junshi66/services/trackbacks/99019.html</trackback:ping><description><![CDATA[<p>以下为在asp中增加一个sql server2000用户函数,</p>
<p>并为建立一个数据库，给他dbo的权限 ' 注意：sql server的验证方式不要选仅为windows方式， ' 允许远程sql server连接 ' 该函数已通过测试'</p>
<p>' 参数：StrLoginName:新增登录名，StrPwd：登录名的密码，StrDBName:新建数据库名 ' 函数内局部变量说明:StrServer:服务器所在机器名(本机为local)，StrUid:sql管理员， ' StrSaPwd:sql管理员密码。以上三个变量应根据你的情况设置 <br>' 该函数主要调用系统存储过程来实现的 <br>' 注意：本函数没有容错处理，如出现错误，可以确定是你的sql server设置有问题，或已存在该login帐号或该数据库 ' call AddUserToMSSQL("testlogin","iamhere","db_test") <br>Sub AddUserToMSSQL(StrLoginName,StrPwd,StrDBName) '定义服务器变量和系统管理员登录信息，根据具体情况修改</p>
<p>Dim StrServer,StrUid,StrSaPwd StrServer="(local)" StrUid="sa" StrSaPwd="" Dim Conn '数据库连接<br>Dim StrDSN '数据库连接字符串<br>Dim StrCmd '命令字符串<br>StrDSN="driver={SQL server};server="&amp;StrServer&amp;";uid="&amp;StrUid&amp;";pwd="&amp;StrSaPwd&amp;";database=master" '建立和数据库master的连接 set Conn = Server.CreateObject("ADODB.Connection") Conn.Open StrDSN<br>'新建一数据库 StrCmd="CREATE DATABASE "&amp;StrDBName Conn.execute(StrCmd) '新建一登录帐号 StrCmd="sp_addlogin '"&amp;StrLoginName&amp;"','"&amp;StrPwd&amp;"','"&amp;StrDBName&amp;"'" Conn.execute(StrCmd) Conn.Close <br>'建立与新建数据库的连接，并赋给新登录帐号访问新建数据库的权利 StrDSN="driver={SQL server}; server="&amp;StrServer&amp;";uid="&amp;StrUid&amp;"; <br>pwd="&amp;StSarPwd&amp;";database="&amp;StrDBName StrCmd="sp_grantdbaccess '"&amp;StrLoginName&amp;"'" Conn.Open StrDSN Conn.execute(StrCmd)<br>'使新登录帐号成为新建数据库的拥有者 StrCmd="sp_addrolemember 'db_owner','"&amp;StrLoginName&amp;"'" Conn.execute(StrCmd) '关闭释放连接 Conn.Close Set Conn=Nothing Response.Write "用户 "&amp;StrLoginName&amp;" 成功建立!,并且已为他建立了一个数据库 "&amp;StrDBName&amp;"!" End Sub</p>
<img src ="http://www.cppblog.com/junshi66/aggbug/99019.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/junshi66/" target="_blank">军</a> 2009-10-20 12:03 <a href="http://www.cppblog.com/junshi66/archive/2009/10/20/99019.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>