<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="./clientscript/vbulletin_css/rsstyle.css"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>LinuxSir.Org - Linux 程序设计专题讨论</title>
		<link>http://www.linuxsir.org/bbs</link>
		<description>Linux环境综合程序设计讨论区；欢迎弟兄们加入版主之列！</description>
		<language>zh</language>
		<lastBuildDate>Fri, 10 Sep 2010 15:56:09 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.linuxsir.org/bbs/images/misc/rss.jpg</url>
			<title>LinuxSir.Org - Linux 程序设计专题讨论</title>
			<link>http://www.linuxsir.org/bbs</link>
		</image>
		<item>
			<title>一个关于共享内存操作的问题，希望高手帮忙下啦，多谢～</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=372086&amp;goto=newpost</link>
			<pubDate>Wed, 08 Sep 2010 13:59:52 GMT</pubDate>
			<description><![CDATA[code:
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <stdio.h>
#include "def.h"

#define BUF_SIZE 1024
#define MY_KEY    30

int main(void)
{
    int i_shmid = 0;
    char *p_shm = NULL;
    
    i_shmid = shmget(MY_KEY, BUF_SIZE, IPC_CREAT);
    if (-1 == i_shmid)
    {
        ASSERT(FALSE);
        return 1;
    }
    
    printf(" The shm_id is %u.\r\n", i_shmid);
    
    p_shm = shmat(i_shmid, 0, 0);

    if ((void *)-1 == p_shm)
    {
        ASSERT(FALSE);
        return 1;
    }
   
    printf(" The share memory address starts at: 0x%x\r\n", p_shm);
    
    return 1;
}

代码就是像上面这样的，就是创建一个共享内存，并且附加到本进程而已，可是在附加的时候总是出错，得到的指针是无效的(0xffffffff)，是有什么地方出错了么？

我是比着教材来做的阿～

还有就是我看大家在帖子中贴程序都有一个单独的下拉框，是怎么搞的啊？]]></description>
			<content:encoded><![CDATA[<div>code:<br />
#include &lt;sys/ipc.h&gt;<br />
#include &lt;sys/shm.h&gt;<br />
#include &lt;sys/sem.h&gt;<br />
#include &lt;stdio.h&gt;<br />
#include &quot;def.h&quot;<br />
<br />
#define BUF_SIZE 1024<br />
#define MY_KEY    30<br />
<br />
int main(void)<br />
{<br />
    int i_shmid = 0;<br />
    char *p_shm = NULL;<br />
    <br />
    i_shmid = shmget(MY_KEY, BUF_SIZE, IPC_CREAT);<br />
    if (-1 == i_shmid)<br />
    {<br />
        ASSERT(FALSE);<br />
        return 1;<br />
    }<br />
    <br />
    printf(&quot; The shm_id is %u.\r\n&quot;, i_shmid);<br />
    <br />
    p_shm = shmat(i_shmid, 0, 0);<br />
<br />
    if ((void *)-1 == p_shm)<br />
    {<br />
        ASSERT(FALSE);<br />
        return 1;<br />
    }<br />
   <br />
    printf(&quot; The share memory address starts at: 0x%x\r\n&quot;, p_shm);<br />
    <br />
    return 1;<br />
}<br />
<br />
代码就是像上面这样的，就是创建一个共享内存，并且附加到本进程而已，可是在附加的时候总是出错，得到的指针是无效的(0xffffffff)，是有什么地方出错了么？<br />
<br />
我是比着教材来做的阿～<br />
<br />
还有就是我看大家在帖子中贴程序都有一个单独的下拉框，是怎么搞的啊？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>goodmorningivan</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=372086</guid>
		</item>
		<item>
			<title>在linux上对一个软件进行二次开发,关于编译的问题</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=372004&amp;goto=newpost</link>
			<pubDate>Sat, 04 Sep 2010 11:33:18 GMT</pubDate>
			<description>现在要在linux上对一个软件做二次开发，其实也就是在源代码的基础上进行修改或者添加一些功能，现在的问题是，该软件有点大，如果我每次改一点儿代码来进行测试的时候就进行一次完整的编译，这个编译应该会非常的花时间吧，有没有办法每次改一点儿代码，编译的时候就只把代码变化的部分编译到以前编译好的软件里面进去就可以啊，不然这个也太费时间了。</description>
			<content:encoded><![CDATA[<div>现在要在linux上对一个软件做二次开发，其实也就是在源代码的基础上进行修改或者添加一些功能，现在的问题是，该软件有点大，如果我每次改一点儿代码来进行测试的时候就进行一次完整的编译，这个编译应该会非常的花时间吧，有没有办法每次改一点儿代码，编译的时候就只把代码变化的部分编译到以前编译好的软件里面进去就可以啊，不然这个也太费时间了。</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>liukunmeister</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=372004</guid>
		</item>
		<item>
			<title>opensuse 编译qsopcast时出错，哪位大侠帮我一下。</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371969&amp;goto=newpost</link>
			<pubDate>Fri, 03 Sep 2010 05:20:30 GMT</pubDate>
			<description><![CDATA[cmake -DCMAKE_BUILD_TYPE=relwithdeb ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt-Version 4.6.3 (using /usr/bin/qmake)
-- Looking for _POSIX_TIMERS
-- Looking for _POSIX_TIMERS - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hurriedlymatilda/qsopcast-read-only/build

make
[  2%] Generating tabwidget.moc
[  4%] Generating abstractchannel.moc                                           
[  7%] Generating channel_argument.moc                                          
[  9%] Generating channel_bookmark.moc                                          
[ 12%] Generating channel_history.moc                                           
[ 14%] Generating channel_pplive.moc                                            
[ 17%] Generating channel_ppstream.moc                                          
[ 19%] Generating channel_sopcast.moc                                           
[ 21%] Generating channellistmodel.moc                                          
[ 24%] Generating channellistview.moc                                           
[ 26%] Generating config.moc                                                    
[ 29%] Generating filterbar.moc                                                 
[ 31%] Generating menubar.moc                                                   
[ 34%] Generating pageplay.moc                                                  
[ 36%] Generating pagerecord.moc                                                
[ 39%] Generating playfork.moc                                                  
[ 41%] Generating qsopcast.moc                                                  
[ 43%] Generating recorder.moc                                                  
[ 46%] Generating searchedit.moc                                                
Scanning dependencies of target qsopcast                                        
[ 48%] Building CXX object src/CMakeFiles/qsopcast.dir/abstractchannel.cpp.o    
[ 51%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_argument.cpp.o   
[ 53%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_bookmark.cpp.o   
[ 56%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_history.cpp.o    
[ 58%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_pplive.cpp.o     
[ 60%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_ppstream.cpp.o   
[ 63%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_sopcast.cpp.o    
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp: In member function ‘void ChannelListSopcast::parse()’:
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:280:66: error: cannot call constructor ‘QString::QString’ directly
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:280:66: error:   for a function-style cast, remove the redundant ‘::QString’
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:282:70: error: cannot call constructor ‘QString::QString’ directly
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:282:70: error:   for a function-style cast, remove the redundant ‘::QString’
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:318:56: error: cannot call constructor ‘QString::QString’ directly
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:318:56: error:   for a function-style cast, remove the redundant ‘::QString’
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:320:60: error: cannot call constructor ‘QString::QString’ directly
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:320:60: error:   for a function-style cast, remove the redundant ‘::QString’
make[2]: *** [src/CMakeFiles/qsopcast.dir/channel_sopcast.cpp.o] 错误 1
make[1]: *** [src/CMakeFiles/qsopcast.dir/all] 错误 2
make: *** [all] 错误 2]]></description>
			<content:encoded><![CDATA[<div>cmake -DCMAKE_BUILD_TYPE=relwithdeb ..<br />
-- The C compiler identification is GNU<br />
-- The CXX compiler identification is GNU<br />
-- Check for working C compiler: /usr/bin/gcc<br />
-- Check for working C compiler: /usr/bin/gcc -- works<br />
-- Detecting C compiler ABI info<br />
-- Detecting C compiler ABI info - done<br />
-- Check for working CXX compiler: /usr/bin/c++<br />
-- Check for working CXX compiler: /usr/bin/c++ -- works<br />
-- Detecting CXX compiler ABI info<br />
-- Detecting CXX compiler ABI info - done<br />
-- Looking for Q_WS_X11<br />
-- Looking for Q_WS_X11 - found<br />
-- Looking for Q_WS_WIN<br />
-- Looking for Q_WS_WIN - not found.<br />
-- Looking for Q_WS_QWS<br />
-- Looking for Q_WS_QWS - not found.<br />
-- Looking for Q_WS_MAC<br />
-- Looking for Q_WS_MAC - not found.<br />
-- Found Qt-Version 4.6.3 (using /usr/bin/qmake)<br />
-- Looking for _POSIX_TIMERS<br />
-- Looking for _POSIX_TIMERS - found<br />
-- Configuring done<br />
-- Generating done<br />
-- Build files have been written to: /home/hurriedlymatilda/qsopcast-read-only/build<br />
<br />
make<br />
[  2%] Generating tabwidget.moc<br />
[  4%] Generating abstractchannel.moc                                           <br />
[  7%] Generating channel_argument.moc                                          <br />
[  9%] Generating channel_bookmark.moc                                          <br />
[ 12%] Generating channel_history.moc                                           <br />
[ 14%] Generating channel_pplive.moc                                            <br />
[ 17%] Generating channel_ppstream.moc                                          <br />
[ 19%] Generating channel_sopcast.moc                                           <br />
[ 21%] Generating channellistmodel.moc                                          <br />
[ 24%] Generating channellistview.moc                                           <br />
[ 26%] Generating config.moc                                                    <br />
[ 29%] Generating filterbar.moc                                                 <br />
[ 31%] Generating menubar.moc                                                   <br />
[ 34%] Generating pageplay.moc                                                  <br />
[ 36%] Generating pagerecord.moc                                                <br />
[ 39%] Generating playfork.moc                                                  <br />
[ 41%] Generating qsopcast.moc                                                  <br />
[ 43%] Generating recorder.moc                                                  <br />
[ 46%] Generating searchedit.moc                                                <br />
Scanning dependencies of target qsopcast                                        <br />
[ 48%] Building CXX object src/CMakeFiles/qsopcast.dir/abstractchannel.cpp.o    <br />
[ 51%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_argument.cpp.o   <br />
[ 53%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_bookmark.cpp.o   <br />
[ 56%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_history.cpp.o    <br />
[ 58%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_pplive.cpp.o     <br />
[ 60%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_ppstream.cpp.o   <br />
[ 63%] Building CXX object src/CMakeFiles/qsopcast.dir/channel_sopcast.cpp.o    <br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp: In member function ‘void ChannelListSopcast::parse()’:<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:280:66: error: cannot call constructor ‘QString::QString’ directly<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:280:66: error:   for a function-style cast, remove the redundant ‘::QString’<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:282:70: error: cannot call constructor ‘QString::QString’ directly<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:282:70: error:   for a function-style cast, remove the redundant ‘::QString’<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:318:56: error: cannot call constructor ‘QString::QString’ directly<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:318:56: error:   for a function-style cast, remove the redundant ‘::QString’<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:320:60: error: cannot call constructor ‘QString::QString’ directly<br />
/home/hurriedlymatilda/qsopcast-read-only/src/channel_sopcast.cpp:320:60: error:   for a function-style cast, remove the redundant ‘::QString’<br />
make[2]: *** [src/CMakeFiles/qsopcast.dir/channel_sopcast.cpp.o] 错误 1<br />
make[1]: *** [src/CMakeFiles/qsopcast.dir/all] 错误 2<br />
make: *** [all] 错误 2</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>oddhornedant</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371969</guid>
		</item>
		<item>
			<title>怪事！文件系统改个名字就挂载不上了</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371790&amp;goto=newpost</link>
			<pubDate>Wed, 25 Aug 2010 03:22:46 GMT</pubDate>
			<description><![CDATA[问题：有一个文件系统cefs，我使用lsmod查看可以发现有这个模块
并且可以挂载mount -t cefs addr:/ /home 成功
查看df -TH 可以看到挂载上了。
现在我重新编译这个模块，并改名为bsdfs
使用rmmod cefs ，lsmod 找不到cefs这个模块
在执行insmod bsdfs，lsmod 看到 有bsdfs这个模块
那为什么在 mount -t bsdfs addr:/ /home 出现unkown filesystem type "bsdfs"这样的提示信息

请问高手们这是为什么？]]></description>
			<content:encoded><![CDATA[<div>问题：有一个文件系统cefs，我使用lsmod查看可以发现有这个模块<br />
并且可以挂载mount -t cefs addr:/ /home 成功<br />
查看df -TH 可以看到挂载上了。<br />
现在我重新编译这个模块，并改名为bsdfs<br />
使用rmmod cefs ，lsmod 找不到cefs这个模块<br />
在执行insmod bsdfs，lsmod 看到 有bsdfs这个模块<br />
那为什么在 mount -t bsdfs addr:/ /home 出现unkown filesystem type &quot;bsdfs&quot;这样的提示信息<br />
<br />
请问高手们这是为什么？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>hjwsm1989</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371790</guid>
		</item>
		<item>
			<title>本人业余初学编程,碰到个简单问题,望有大虾帮助。</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371722&amp;goto=newpost</link>
			<pubDate>Mon, 23 Aug 2010 03:39:40 GMT</pubDate>
			<description><![CDATA[.
|-- Makefile
|-- callbacks
| |-- callbacks.c
| `-- callbacks.h
|-- gui.glade
|-- h
| `-- target.h
`-- main.c

这是我目录下的源文件摆放顺序，我将所有的头文件定义单独放在了h文件夹下，然后把所有回调函数放在了callbacks文件夹下。

以下是我的makefile

CC=gcc
SRCS=main.c callbacks/callbacks.c
PROG_NAME=main
INCS=h/target.h callbacks/callbacks.h
OBJS=${SRCS:.c=.o}
#从xx.c 文件得到 xx.o 文件
LIBS=gtk+-2.0
#----------------------------------用户修改区域 结束
CFLAGS=`pkg-config --cflags ${LIBS}` -g -Wall
#指代编译程序时使用到的一些编译选项， -g 表示生成调试信息以供GDB使用
LDFLAGS=`pkg-config --libs ${LIBS}` -g -Wall
#用来指代进行程序连接时使用到的一些选项
#-----------------------------------

all: ${PROG_NAME}
##这一句开始，Makefile就开始使用 目标:依赖 的关系来处理真正的程序编译而它们下边以 TAB 键开始的行就是满足依赖关系后要运行的程序了
${PROG_NAME}:${OBJS}
${CC} -o ${PROG_NAME} ${OBJS} ${LDFLAGS}
#注意：上边”${CC}" 的前边有一个TAB键，而不是空格

${OBJS}:${INCS}
##如果有头文件修改则自动编译源文件
.c.o:
${CC} -c $< ${CFLAGS}
#当遇到一个 .c 文件，将使用这条命令将.c文件编译为.o文件 命令中$<用来代替对应的.c 文件的文件名。（通配符？）
clean:
rm -f *.o ${PROG_NAME}
rebuild: clean all


然后编译后出现如下情况：gcc: callbacks/callbacks.o: No such file or directory


我现在一直不清除如何分开头文件和头文件相关的.c文件的摆放顺序(可能我描述这个问题也有问题),关于这个的定义部分我看一些教程也是一知半懂,我只是想把这个程序写得有条例一些,各种模块函数调用都用文件夹分类等等,但我不知道如何在makefile中组织这些关系。这个程序里的callbacks.c 在callbacks文件夹里，main.c中调用了callback.h，同样callback.h也在callbacks文件夹里。
main.c的开头是这样：
#include "h/target.h"
#include "callbacks/callbacks.h"

程序本身很简单，我把callbacks.h和callbacks.c和main.c放在同一目录下都能通过。


希望有达达明白我这个半吊子描述的问题。。。我也不知道怎么说清除了。。呵呵。。]]></description>
			<content:encoded><![CDATA[<div>.<br />
|-- Makefile<br />
|-- callbacks<br />
| |-- callbacks.c<br />
| `-- callbacks.h<br />
|-- gui.glade<br />
|-- h<br />
| `-- target.h<br />
`-- main.c<br />
<br />
这是我目录下的源文件摆放顺序，我将所有的头文件定义单独放在了h文件夹下，然后把所有回调函数放在了callbacks文件夹下。<br />
<br />
以下是我的makefile<br />
<br />
CC=gcc<br />
SRCS=main.c callbacks/callbacks.c<br />
PROG_NAME=main<br />
INCS=h/target.h callbacks/callbacks.h<br />
OBJS=${SRCS:.c=.o}<br />
#从xx.c 文件得到 xx.o 文件<br />
LIBS=gtk+-2.0<br />
#----------------------------------用户修改区域 结束<br />
CFLAGS=`pkg-config --cflags ${LIBS}` -g -Wall<br />
#指代编译程序时使用到的一些编译选项， -g 表示生成调试信息以供GDB使用<br />
LDFLAGS=`pkg-config --libs ${LIBS}` -g -Wall<br />
#用来指代进行程序连接时使用到的一些选项<br />
#-----------------------------------<br />
<br />
all: ${PROG_NAME}<br />
##这一句开始，Makefile就开始使用 目标:依赖 的关系来处理真正的程序编译而它们下边以 TAB 键开始的行就是满足依赖关系后要运行的程序了<br />
${PROG_NAME}:${OBJS}<br />
${CC} -o ${PROG_NAME} ${OBJS} ${LDFLAGS}<br />
#注意：上边”${CC}&quot; 的前边有一个TAB键，而不是空格<br />
<br />
${OBJS}:${INCS}<br />
##如果有头文件修改则自动编译源文件<br />
.c.o:<br />
${CC} -c $&lt; ${CFLAGS}<br />
#当遇到一个 .c 文件，将使用这条命令将.c文件编译为.o文件 命令中$&lt;用来代替对应的.c 文件的文件名。（通配符？）<br />
clean:<br />
rm -f *.o ${PROG_NAME}<br />
rebuild: clean all<br />
<br />
<br />
然后编译后出现如下情况：gcc: callbacks/callbacks.o: No such file or directory<br />
<br />
<br />
我现在一直不清除如何分开头文件和头文件相关的.c文件的摆放顺序(可能我描述这个问题也有问题),关于这个的定义部分我看一些教程也是一知半懂,我只是想把这个程序写得有条例一些,各种模块函数调用都用文件夹分类等等,但我不知道如何在makefile中组织这些关系。这个程序里的callbacks.c 在callbacks文件夹里，main.c中调用了callback.h，同样callback.h也在callbacks文件夹里。<br />
main.c的开头是这样：<br />
#include &quot;h/target.h&quot;<br />
#include &quot;callbacks/callbacks.h&quot;<br />
<br />
程序本身很简单，我把callbacks.h和callbacks.c和main.c放在同一目录下都能通过。<br />
<br />
<br />
希望有达达明白我这个半吊子描述的问题。。。我也不知道怎么说清除了。。呵呵。。</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>formylove2</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371722</guid>
		</item>
		<item>
			<title>请教: 二级指针转换为一级指针?</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371456&amp;goto=newpost</link>
			<pubDate>Thu, 12 Aug 2010 05:29:19 GMT</pubDate>
			<description><![CDATA[先看代码:
代码:
---------
typedef void *SMIQ;
bool smi_receive_getaddr( SMIQ *sqp, void **addr);

struct my_msg *msg;
...
smi_rcceive_getaddr(sqp, (void **)&msg);

typedef struct {
        ...
} SMIQ_FIFO;

bool smi_close_fifo(SMIQ *sqp)
{
        SMIQ_FIFO *p = (SMIQ_FIFO *)sqp;    //二级指针转换为一级指针?
...
}
---------
为什么要把二级指针转换为一级指针呢?
有什么特殊的用途?]]></description>
			<content:encoded><![CDATA[<div>先看代码:<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">代码:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"><font color="Blue">typedef void *SMIQ;</font><br />
bool smi_receive_getaddr( SMIQ *sqp, void **addr);<br />
<br />
struct my_msg *msg;<br />
...<br />
smi_rcceive_getaddr(sqp, (void **)&amp;msg);<br />
<br />
typedef struct {<br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
} SMIQ_FIFO;<br />
<br />
bool smi_close_fifo(SMIQ *sqp)<br />
{<br />
&nbsp; &nbsp; &nbsp; <font color="Blue">&nbsp; SMIQ_FIFO *p = (SMIQ_FIFO *)sqp;&nbsp; &nbsp; //二级指针转换为一级指针?</font><br />
...<br />
}</code><hr />
</div>为什么要把二级指针转换为一级指针呢?<br />
有什么特殊的用途?</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=76">Linux 程序设计专题讨论</category>
			<dc:creator>叶叶叶</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371456</guid>
		</item>
	</channel>
</rss>
