Test-extern-make.7z


-
关于多文件使用extern全局变量的见解
921KB
c语言深度剖析
2011-12-28第一章 关键字......................................................... 1.1,最宽恒大量的关键字----auto.................. 1.2,最快的关键字---- register........................ 1.2.1,皇帝身边的小太监----寄存器...... 1.2.2,使用register修饰符的注意点..... 1.3,最名不符实的关键字----static................ 1.3.1,修饰变量....................................... 1.3.2,修饰函数....................................... 1.4,基本数据类型----short、int、long、cha 1.4.1,数据类型与“模子”........................ 1.4.2,变量的命名规则........................... 1.5,最冤枉的关键字----sizeof....................... 1.5.1,常年被人误认为函数................... 1.5.2,sizeof(int)*p表示什么意思? 1.4,signed、unsigned关键字........................ 1.6,if、else组合............................................. 1.6.1,bool变量与“零值”进行比较....... 1.6.2, float变量与“零值”进行比较......... 1.6.3,指针变量与“零值”进行比较....... 1.6.4,else到底与哪个 if配对呢?.......1.6.6,使用if语句的其他注意事项...... 1.7,switch、case组合................................... 1.7.1,不要拿青龙偃月刀去削苹果...... 1.7.2,case关键字后面的值有什么要求 1.7.3,case语句的排列顺序................... 1.7.4,使用case语句的其他注意事项. 1.8,do、while、for关键字........................... 1.8.1,break与 continue的区别............. 1.8.2,循环语句的注意点....................... 1.9,goto关键字.............................................. 1.10,void关键字............................................ 1.10.1,void a?.................................... 1.10,return关键字......................................... 1.11,const关键字也许该被替换为readolny 1.11.2,节省空间,避免不必要的内存 1.12,最易变的关键字----volatile.................. 1.13,最会带帽子的关键字----extern............ 1.14,struct关键字.......................................... 1.14.1,空结构体多大?......................... 1.14.2,柔性数组..................................... 1.14.3,struct与 class的区别.................
4.8MB
cocos2d-x c++的iconv.rar
2015-04-22解决cocos2d-x中文显示问题 /* Copyright (C) 1999-2003, 2005-2006, 2008-2011 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU LIBICONV Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU LIBICONV Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* When installed, this file is called "iconv.h". */ #ifndef _LIBICONV_H #define _LIBICONV_H #define _LIBICONV_VERSION 0x010E /* version number: (major<<8) + minor */ extern @DLL_VARIABLE@ int _libiconv_version; /* Likewise */ /* We would like to #include any system header file which could define iconv_t, 1. in order to eliminate the risk that the user gets compilation errors because some other system header file includes /usr/include/iconv.h which defines iconv_t or declares iconv after this file, 2. when compiling for LIBICONV_PLUG, we need the proper iconv_t type in order to produce binary compatible code. But gcc's #include_next is not portable. Thus, once libiconv's iconv.h has been installed in /usr/local/include, there is no way any more to include the original /usr/include/iconv.h. We simply have to get away without it. Ad 1. The risk that a system header file does #include "iconv.h" or #include_next "iconv.h" is small. They all do #include <iconv.h>. Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It has to be a scalar type because (iconv_t)(-1) is a possible return value from iconv_open().) */ /* Define iconv_t ourselves. */ #undef iconv_t #define iconv_t libiconv_t typedef void* iconv_t; /* Get size_t declaration. Get wchar_t declaration if it exists. */ #include <stddef.h> /* Get errno declaration and values. */ #include <errno.h> /* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS, have EILSEQ in a different header. On these systems, define EILSEQ ourselves. */ #ifndef EILSEQ #define EILSEQ @EILSEQ@ #endif #ifdef __cplusplus extern "C" { #endif /* Allocates descriptor for code conversion from encoding ‘fromcode’ to encoding ‘tocode’. */ #ifndef LIBICONV_PLUG #define iconv_open libiconv_open #endif extern iconv_t iconv_open (const char* tocode, const char* fromcode); /* Converts, using conversion descriptor ‘cd’, at most ‘*inbytesleft’ bytes starting at ‘*inbuf’, writing at most ‘*outbytesleft’ bytes starting at ‘*outbuf’. Decrements ‘*inbytesleft’ and increments ‘*inbuf’ by the same amount. Decrements ‘*outbytesleft’ and increments ‘*outbuf’ by the same amount. */ #ifndef LIBICONV_PLUG #define iconv libiconv #endif extern size_t iconv (iconv_t cd, @ICONV_CONST@ char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft); /* Frees resources allocated for conversion descriptor ‘cd’. */ #ifndef LIBICONV_PLUG #define iconv_close libiconv_close #endif extern int iconv_close (iconv_t cd); #ifdef __cplusplus } #endif #ifndef LIBICONV_PLUG /* Nonstandard extensions. */ #if @USE_MBSTATE_T@ #if @BROKEN_WCHAR_H@ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before <wchar.h>. BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included before <wchar.h>. */ #include <stddef.h> #include <stdio.h> #include <time.h> #endif #include <wchar.h> #endif #ifdef __cplusplus extern "C" { #endif /* A type that holds all memory needed by a conversion descriptor. A pointer to such an object can be used as an iconv_t. */ typedef struct { void* dummy1[28]; #if @USE_MBSTATE_T@ mbstate_t dummy2; #endif } iconv_allocation_t; /* Allocates descriptor for code conversion from encoding ‘fromcode’ to encoding ‘tocode’ into preallocated memory. Returns an error indicator (0 or -1 with errno set). */ #define iconv_open_into libiconv_open_into extern int iconv_open_into (const char* tocode, const char* fromcode, iconv_allocation_t* resultp); /* Control of attributes. */ #define iconvctl libiconvctl extern int iconvctl (iconv_t cd, int request, void* argument); /* Hook performed after every successful conversion of a Unicode character. */ typedef void (*iconv_unicode_char_hook) (unsigned int uc, void* data); /* Hook performed after every successful conversion of a wide character. */ typedef void (*iconv_wide_char_hook) (wchar_t wc, void* data); /* Set of hooks. */ struct iconv_hooks { iconv_unicode_char_hook uc_hook; iconv_wide_char_hook wc_hook; void* data; }; /* Fallback function. Invoked when a small number of bytes could not be converted to a Unicode character. This function should process all bytes from inbuf and may produce replacement Unicode characters by calling the write_replacement callback repeatedly. */ typedef void (*iconv_unicode_mb_to_uc_fallback) (const char* inbuf, size_t inbufsize, void (*write_replacement) (const unsigned int *buf, size_t buflen, void* callback_arg), void* callback_arg, void* data); /* Fallback function. Invoked when a Unicode character could not be converted to the target encoding. This function should process the character and may produce replacement bytes (in the target encoding) by calling the write_replacement callback repeatedly. */ typedef void (*iconv_unicode_uc_to_mb_fallback) (unsigned int code, void (*write_replacement) (const char *buf, size_t buflen, void* callback_arg), void* callback_arg, void* data); #if @HAVE_WCHAR_T@ /* Fallback function. Invoked when a number of bytes could not be converted to a wide character. This function should process all bytes from inbuf and may produce replacement wide characters by calling the write_replacement callback repeatedly. */ typedef void (*iconv_wchar_mb_to_wc_fallback) (const char* inbuf, size_t inbufsize, void (*write_replacement) (const wchar_t *buf, size_t buflen, void* callback_arg), void* callback_arg, void* data); /* Fallback function. Invoked when a wide character could not be converted to the target encoding. This function should process the character and may produce replacement bytes (in the target encoding) by calling the write_replacement callback repeatedly. */ typedef void (*iconv_wchar_wc_to_mb_fallback) (wchar_t code, void (*write_replacement) (const char *buf, size_t buflen, void* callback_arg), void* callback_arg, void* data); #else /* If the wchar_t type does not exist, these two fallback functions are never invoked. Their argument list therefore does not matter. */ typedef void (*iconv_wchar_mb_to_wc_fallback) (); typedef void (*iconv_wchar_wc_to_mb_fallback) (); #endif /* Set of fallbacks. */ struct iconv_fallbacks { iconv_unicode_mb_to_uc_fallback mb_to_uc_fallback; iconv_unicode_uc_to_mb_fallback uc_to_mb_fallback; iconv_wchar_mb_to_wc_fallback mb_to_wc_fallback; iconv_wchar_wc_to_mb_fallback wc_to_mb_fallback; void* data; }; /* Requests for iconvctl. */ #define ICONV_TRIVIALP 0 /* int *argument */ #define ICONV_GET_TRANSLITERATE 1 /* int *argument */ #define ICONV_SET_TRANSLITERATE 2 /* const int *argument */ #define ICONV_GET_DISCARD_ILSEQ 3 /* int *argument */ #define ICONV_SET_DISCARD_ILSEQ 4 /* const int *argument */ #define ICONV_SET_HOOKS 5 /* const struct iconv_hooks *argument */ #define ICONV_SET_FALLBACKS 6 /* const struct iconv_fallbacks *argument */ /* Listing of locale independent encodings. */ #define iconvlist libiconvlist extern void iconvlist (int (*do_one) (unsigned int namescount, const char * const * names, void* data), void* data); /* Canonicalize an encoding name. The result is either a canonical encoding name, or name itself. */ extern const char * iconv_canonicalize (const char * name); /* Support for relocatable packages. */ /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ extern void libiconv_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); #ifdef __cplusplus } #endif #endif #endif /* _LIBICONV_H */
16.18MB
centos 6.5 安装 FFmpeg及转码插件
2017-07-033. 安装FFmpeg 1) 指定第三方插件安装默认目录 [root@localhost ffmpeg]# vi /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/bin /usr/local/lib 2) 安装各插件 安装lame [root@localhost ffmpeg]# tar -zxvf lame-3.99.5.tar.gz [root@localhost lame-3.99.5]# cd lame-3.99.5 [root@localhost lame-3.99.5]# ./configure --enable-shared [root@localhost lame-3.99.5]# make && make install [root@localhost lame-3.99.5]# ldconfig 安装yasm [root@localhost ffmpeg]# tar -zxvf yasm-1.2.0.gz [root@localhost yasm-1.2.0]# cd yasm-1.2.0 [root@localhost yasm-1.2.0]# ./configure --enable-shared [root@localhost yasm-1.2.0]# make && make install [root@localhost yasm-1.2.0]# ldconfig 安装xvidcore (注意目录位置,不在直接的解压后的文件下) [root@localhost ffmpeg]# tar -zxvf xvidcore-1.1.3.tar.gz [root@localhost ffmpeg]# cd xvidcore-1.1.3/build/generic/ [root@localhost generic]# ./configure [root@localhost generic]# make && make install [root@localhost generic]# ldconfig 安装x264 (注意格式为.tar.bz2) [root@localhost ffmpeg]# bunzip2 last_x264.tar.bz2 [root@localhost ffmpeg]# tar -xvf last_x264.tar [root@localhost ffmpeg]# cd x264-snapshot-20121030-2245/ [root@localhost x264-snapshot-20121030-2245]# ./configure --enable-shared [root@localhost x264-snapshot-20121030-2245]# make && make install [root@localhost x264-snapshot-20121030-2245]# ldconfig 安装a52dec [root@localhost ffmpeg]# tar -zxvf a52dec-0.7.4.tar.gz [root@localhost ffmpeg]# cd a52dec-0.7.4 [root@localhost a52dec-0.7.4]# ./configure --enable-shared=PKGS && make && make install [root@localhost a52dec-0.7.4]# ldconfig 安装 faac [root@localhost ffmpeg]# yum install -y automake autoconf libtool [root@localhost ffmpeg]# tar -zxvf faac-1.28.tar.gz [root@localhost ffmpeg]# cd faac-1.28 [root@localhost faac-1.28]# vi ./common/mp4v2/mpeg4ip.h … :123 #ifdef __cplusplus extern "C" { #endif //char *strcasestr(const char *haystack, const char *needle); #ifdef __cplusplus } #endif [root@localhost faac-1.28]# ./bootstrap && ./configure && make && make install [root@localhost faac-1.28]# ldconfig 安装 faad2 [root@localhost ffmpeg]# tar -zxvf faad2-2.7.tar.gz [root@localhost ffmpeg]# cd faad2-2.7 [root@localhost faad2-2.7]# chmod 755 bootstrap [root@localhost faad2-2.7]# ./bootstrap && ./configure && make && make install [root@localhost faad2-2.7]# ldconfig 安装 vo-aacenc [root@localhost ffmpeg]# tar -zxvf vo-aacenc_0.1.3.orig.tar.gz [root@localhost ffmpeg]# cd vo-aacenc-0.1.3/ [root@localhost vo-aacenc-0.1.3]# ./configure [root@localhost vo-aacenc-0.1.3]# make && make install [root@localhost vo-aacenc-0.1.3]# ldconfig 3) 安装FFmpeg [root@localhost ffmpeg]# tar -zxvf ffmpeg-1.2.11.tar.gz [root@localhost ffmpeg]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# ./configure --enable-gpl --enable-version3 --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-libvo-aacenc [root@localhost ffmpeg-1.2.11]# make && make install [root@localhost ffmpeg-1.2.11]# ldconfig [root@localhost ffmpeg-1.2.11]# cp /usr/local/bin/ffmpeg /usr/bin/ 4) 安装qt-faststart [root@localhost ffmpeg-1.2.11]# cd ffmpeg-1.2.11 [root@localhost ffmpeg-1.2.11]# make tools/qt-faststart [root@localhost ffmpeg-1.2.11]# cp -a tools/qt-faststart /usr/bin/ 5) 查看版本和转换测试 查看版本 [root@localhost software]# ffmpeg ffmpeg version 1.2.11 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 21 2016 17:48:12 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16) configuration: --enable-gpl --enable-postproc --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libxvid --enable-libx264 --enable-libmp3lame --enable-libfaac libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 测试 [root@localhost software]# ffmpeg -i ./09.mp4 -y -acodec libmp3lame -ab 128 -ar 22050 -vcodec h264 -b 96k -r 25 ./01.flv … [root@localhost software]# ll total 32232 -rw-r--r--. 1 root root 4378561 Apr 21 17:56 01.flv -rw-r--r--. 1 root root 28609569 Apr 21 17:52 09.mp4 成功!
2.32MB
C语言深度解剖--面试成功的秘诀
2013-07-24第一章 关键 字............................................................................................. ...................................... 9 1.1,最宽恒大量的关键字----auto..........................................................................................11 1.2,最快的关键字---- register............................................................................................... 11 1.2.1,皇帝身边的小太监----寄存器............................................................................. 11 1.2.2,使用 register 修饰符的注意 点.............................................................................11 1.3,最名不符实的关键字----static........................................................................................12 1.3.1,修饰变量...............................................................................................................12 1.3.2,修饰函数...............................................................................................................13 1.4,基本数据类型----short、int、long、char、float、double........................................... 13 1.4.1,数据类型与“模子”............................................................................................... 14 1.4.2,变量的命名规则...................................................................................................14 1.5,最冤枉的关键字----sizeof...............................................................................................18 1.5.1,常年被人误认为函数...........................................................................................18 1.5.2,sizeof(int)*p 表示什么意 思?........................................................................18 1.4,signed、unsigned 关键 字............................................................................................. ...19 1.6,if、else 组 合............................................................................................. ....................... 20 1.6.1,bool 变量与“零值”进行比 较...............................................................................20 1.6.2, float 变量与“零值”进行比 较.................................................................................21 1.6.3,指针变量与“零值”进行比较............................................................................... 21 1.6.4,else 到底与哪个 if 配对 呢?...............................................................................22 1.6.5,if 语句后面的分 号............................................................................................. .. 23 1.6.6,使用 if 语句的其他注意事 项.............................................................................. 24 1.7,switch、case 组 合............................................................................................. .............. 24 1.7.1,不要拿青龙偃月刀去削苹果.............................................................................. 24 1.7.2,case 关键字后面的值有什么要求 吗?.............................................................. 25 1.7.3,case 语句的排列顺 序...........................................................................................25 1.7.4,使用 case 语句的其他注意事 项..........................................................................27 1.8,do、while、for 关键 字............................................................................................. ...... 28 1.8.1,break 与 continue 的区 别.....................................................................................28 1.8.2,循环语句的注意点...............................................................................................29 1.9,goto 关键 字............................................................................................. .........................30 1.10,void 关键 字............................................................................................. .......................31 1.10.1,void a?............................................................................................................31 1.10,return 关键 字............................................................................................. .................... 34 1.11,const 关键字也许该被替换为 readolny....................................................................... 34 1.11.2,节省空间,避免不必要的内存分配,同时提高效率.................................... 35 1.12,最易变的关键字----volatile.......................................................................................... 36 1.13,最会带帽子的关键字----extern....................................................................................
896KB
C语言深度剖析 陈正冲.石虎
2018-11-06C语言深度剖析 陈正冲.石虎 文字版 带完整书签 第一章 关键字...................................................................................................................................9 1.1,最宽恒大量的关键字----auto..........................................................................................11 1.2,最快的关键字---- register............................................................................................... 11 1.2.1,皇帝身边的小太监----寄存器............................................................................. 11 1.2.2,使用 register 修饰符的注意点.............................................................................11 1.3,最名不符实的关键字----static........................................................................................12 1.3.1,修饰变量...............................................................................................................12 1.3.2,修饰函数...............................................................................................................13 1.4,基本数据类型----short、 int、 long、 char、 float、 double........................................... 13 1.4.1,数据类型与“模子”............................................................................................... 14 1.4.2,变量的命名规则...................................................................................................14 1.5,最冤枉的关键字----sizeof...............................................................................................18 1.5.1,常年被人误认为函数...........................................................................................18 1.5.2, sizeof(int) *p 表示什么意思? ........................................................................18 1.4, signed、 unsigned 关键字................................................................................................19 1.6, if、 else 组合.................................................................................................................... 20 1.6.1, bool 变量与“零值”进行比较...............................................................................20 1.6.2, float 变量与“零值”进行比较.................................................................................21 1.6.3,指针变量与“零值”进行比较...............................................................................21 1.6.4, else 到底与哪个 if 配对呢? ...............................................................................22 1.6.5, if 语句后面的分号............................................................................................... 23 1.6.6,使用 if 语句的其他注意事项.............................................................................. 24 1.7, switch、 case 组合........................................................................................................... 24 1.7.1,不要拿青龙偃月刀去削苹果.............................................................................. 24 1.7.2, case 关键字后面的值有什么要求吗? .............................................................. 25 1.7.3, case 语句的排列顺序...........................................................................................25 1.7.4,使用 case 语句的其他注意事项..........................................................................27 1.8, do、 while、 for 关键字................................................................................................... 28 1.8.1, break 与 continue 的区别.....................................................................................28 1.8.2,循环语句的注意点...............................................................................................29 1.9, goto 关键字......................................................................................................................30 1.10, void 关键字....................................................................................................................31 1.10.1, void a? ............................................................................................................31 1.10, return 关键字................................................................................................................. 34 1.11, const 关键字也许该被替换为 readolny....................................................................... 34 1.11.2,节省空间,避免不必要的内存分配,同时提高效率.................................... 35 1.12,最易变的关键字----volatile.......................................................................................... 36 1.13,最会带帽子的关键字----extern.................................................................................... 37 1.14, struct 关键字..................................................................................................................38 1.14.1,空结构体多大? .................................................................................................38 1.14.2,柔性数组.............................................................................................................39 1.14.3, struct 与 class 的区别.........................................................................................40
735KB
C语言深度解剖.zip
2019-06-16第一章关键字...................................................................................................................................9 1.1,最宽恒大量的关键字----auto..........................................................................................11 1.2,最快的关键字---- register............................................................................................... 11 1.2.1,皇帝身边的小太监----寄存器............................................................................. 11 1.2.2,使用register 修饰符的注意点.............................................................................11 1.3,最名不符实的关键字----static........................................................................................12 1.3.1,修饰变量...............................................................................................................12 1.3.2,修饰函数...............................................................................................................13 1.4,基本数据类型----short、int、long、char、float、double........................................... 13 1.4.1,数据类型与“模子”............................................................................................... 14 1.4.2,变量的命名规则...................................................................................................14 1.5,最冤枉的关键字----sizeof...............................................................................................18 1.5.1,常年被人误认为函数...........................................................................................18 1.5.2,sizeof(int)*p 表示什么意思?........................................................................18 1.4,signed、unsigned 关键字................................................................................................19 1.6,if、else 组合.................................................................................................................... 20 1.6.1,bool 变量与“零值”进行比较...............................................................................20 1.6.2, float 变量与“零值”进行比较.................................................................................21 1.6.3,指针变量与“零值”进行比较...............................................................................21 1.6.4,else 到底与哪个if 配对呢?...............................................................................22 1.6.5,if 语句后面的分号............................................................................................... 23 1.6.6,使用if 语句的其他注意事项.............................................................................. 24 1.7,switch、case 组合........................................................................................................... 24 1.7.1,不要拿青龙偃月刀去削苹果.............................................................................. 24 1.7.2,case 关键字后面的值有什么要求吗?.............................................................. 25 1.7.3,case 语句的排列顺序...........................................................................................25 1.7.4,使用case 语句的其他注意事项..........................................................................27 1.8,do、while、for 关键字................................................................................................... 28 1.8.1,break 与continue 的区别.....................................................................................28 1.8.2,循环语句的注意点...............................................................................................29 1.9,goto 关键字......................................................................................................................30 1.10,void 关键字....................................................................................................................31 1.10.1,void a?............................................................................................................31 1.10,return 关键字................................................................................................................. 34 1.11,const 关键字也许该被替换为readolny....................................................................... 34 1.11.2,节省空间,避免不必要的内存分配,同时提高效率.................................... 35 1.12,最易变的关键字----volatile.......................................................................................... 36 1.13,最会带帽子的关键字----extern.................................................................................... 37 1.14,struct 关键字..................................................................................................................38 1.14.1,空结构体多大?.................................................................................................38 1.14.2,柔性数组.............................................................................................................39 1.14.3,struct 与class 的区别.........................................................................................40 1.15,union 关键字..................................................................................................................40
6KB
ARM资料(By打嗝-END122).txt
2011-05-18ARM资料(By打嗝-END122).txtARM资料(By打嗝-END122).txt ARM资料(By打嗝-END122).txtARM资料(By打嗝-END122).txt ARM资料(By打嗝-END122).txtARM资料(By打嗝-END122).txt
2.96MB
0.6版ffmpeg.c在vs2005下编译
2010-11-18我比较笨,用了2天的时间将ffmpeg.c改在vs2005下编译. ---------------------------------- 粗略说说过程吧. 1.ffmpeg.c,牵涉的的文件有audioconvert.h,audioconvert.c,cmdutils.h,cmdutils.c,将c文件改为cpp文件 2.mingw下inttypes.h在ffmpeg.c里主要是一些int32_t的类型定义.弄出来 3.c99的语法(AVRational){1,2}在VC下不支持,我弄了个函数_AVRational()... 这样所有的地方改为_AVRational(1,2)改动不大, 4.几个msys的函数lrintf,llrintf,这是4舍5入 奇怪VC本身没有round的函数,所以我宏替代 #define lrintf(f) (f>=0?(int32_t)(f+(float)0.5)int32_t)(f-0.4) ); 查手册4舍5入法则: 20.4---->20 20.5---->21 -20.5---->-20 -20.6---->-21 --------------------------- 5.还有一个地方 gcc充许除以0,结果为正负最大值,我直接定义了最大值的宏. 6.linux下的函数usleep()精确到微秒,而VC的Sleep,sleep只能是秒,豪秒,这个差距不知道怎么解决.暂时我就让错差存在. 7.其实编的时候,里面很多include的头文件没用着的,我就注释了. 8.加上extern "C"{};规范 =========================== 总的说来,这样调试跟踪顺序是对的.对学习帮助较大.
3.26MB
C语言深度揭秘
2012-04-12目录 第一章 关键字...............9 1.1,最宽恒大量的关键字----auto................................11 1.2,最快的关键字---- register..................................... 11 1.2.1,皇帝身边的小太监----寄存器................... 11 1.2.2,使用register修饰符的注意点...................11 1.3,最名不符实的关键字----static..............................12 1.3.1,修饰变量.....................................................12 1.3.2,修饰函数.....................................................13 1.4,基本数据类型----short、int、long、char、float、double........................................... 13 1.4.1,数据类型与“模子”..................................... 14 1.4.2,变量的命名规则.........................................14 1.5,最冤枉的关键字----sizeof.....................................18 1.5.1,常年被人误认为函数.................................18 1.5.2,sizeof(int)*p表示什么意思?..............18 1.4,signed、unsigned关键字......................................19 1.6,if、else组合 20 1.6.1,bool变量与“零值”进行比较.....................20 1.6.2, float变量与“零值”进行比较.......................21 1.6.3,指针变量与“零值”进行比较.....................21 1.6.4,else到底与哪个 if配对呢?.....................22 1.6.5,if语句后面的分号..................................... 23 1.6.6,使用if语句的其他注意事项.................... 24 1.7,switch、case组合................................................. 24 1.7.1,不要拿青龙偃月刀去削苹果.................... 24 1.7.2,case关键字后面的值有什么要求吗?.... 25 1.7.3,case语句的排列顺序.................................25 1.7.4,使用case语句的其他注意事项................27 1.8,do、while、for关键字......................................... 28 1.8.1,break与 continue的区别...........................28 1.8.2,循环语句的注意点.....................................29 1.9,goto关键字..30 1.10,void关键字31 1.10.1,void a?..................................................31 1.10,return关键字....................................................... 34 1.11,const关键字也许该被替换为readolny............. 34 1.11.2,节省空间,避免不必要的内存分配,同时提高效率.................................... 35 1.12,最易变的关键字----volatile................................ 36 1.13,最会带帽子的关键字----extern.......................... 37 1.14,struct关键字........................................................38 1.14.1,空结构体多大?.......................................38 1.14.2,柔性数组...................................................39 1.14.3,struct与 class的区别...............................40 1.15,union关键字........................................................40 1.15.1,大小端模式对union类型数据的影响... 40 1.15.2,如何用程序确认当前系统的存储模式?........................................................ 41 1.16,enum关键字........................................................42 1.16.1, 枚举类型的使用方法................................43 1.16.2,枚举与#define宏的区别..........................43 1.17,伟大的缝纫师----typedef关键字....................... 44 1.17.1,关于马甲的笑话.......................................44 1.17.2,历史的误会----也许应该是 typerename. 44 1.17.3,typedef与#define的区别.........................45 1.17.4,#define a int[10]与 typedef int a[10];.... 46 第二章 符号................. 49 2.1,注释符号......50 2.1.1,几个似非而是的注释问题.........................50 2.1.2,y = x/*p....................................................... 51 2.1.3,怎样才能写出出色的注释.........................51 2.1.3.1,安息吧,路德维希.凡.贝多芬....... 51 2.1.3.2,windows 大师们用注释讨论天气问题....................................................51 2.1.3.3,出色注释的基本要求..................... 52 2.2,接续符和转义符....................................................53 2.3,单引号、双引号....................................................54 2.4,逻辑运算符..54 2.5,位运算符......55 2.5.1,左移和右移.................................................55 2.5.2,0x01<<2+3的值为多少?.........................55 2.6,花括号..........56 2.7,++、--操作符.........................................................56 2.7.1,++i+++i+++i............................................... 57 2.7.2,贪心法.........................................................57 2.8,2/(-2)的值是多少?...............................................58 2.9,运算符的优先级....................................................58 2.9.1, 运算符的优先级表......................................58 2.9.2,一些容易出错的优先级问题.................... 60 第三章 预处理.............61 3.1,宏定义..........62 3.1.1,数值宏常量.................................................62 3.1.2,字符串宏常量.............................................62 3.1.3,用define宏定义注释符号?.................... 63 3.1.4,用define宏定义表达式.............................63 3.1.5,宏定义中的空格.........................................64 3.1.6,#undef64 3.2,条件编译......65 3.3,文件包含................................................................66 3.4,#error预处理......................................................... 66 3.5,#line预处理.67 3.6,#pragma预处理.....................................................67 3.6.8,#pragma pack.............................................. 69 3.6.8.1,为什么会有内存对齐?................. 70 3.6.8.2,如何避免内存对齐的影响............. 70 3.7, #运算符..........72 3.8,##预算符......72 第四章 指针和数组.....74 4.1,指针..............74 4.1.1,指针的内存布局.........................................74 4.1.2,“*”与防盗门的钥匙................................... 75 4.1.3,int *p = NULL 和*p = NULL 有什么区别?.................................................... 75 4.1.4,如何将数值存储到指定的内存地址........ 76 4.1.5,编译器的bug?..........................................77 4.1.6,如何达到手中无剑、胸中也无剑的地步 78 4.2,数组..............78 4.2.1,数组的内存布局.........................................78 4.2.3,数组名a 作为左值和右值的区别.............79 4.3,指针与数组之间的恩恩怨怨................................80 4.3.1,以指针的形式访问和以下标的形式访问 80 4.3.1.1,以指针的形式访问和以下标的形式访问指针....................................... 81 4.3.1.2,以指针的形式访问和以下标的形式访问数组....................................... 81 4.3.2,a和&a的区别............................................ 81 4.3.3,指针和数组的定义与声明.........................83 4.3.3.1,定义为数组,声明为指针............. 83 4.3.3.2,定义为指针,声明为数组............. 85 4.3.4,指针和数组的对比.....................................85 4.4,指针数组和数组指针............................................86 4.4.1,指针数组和数组指针的内存布局............ 86 4.4.3,再论a 和&a 之间的区别...........................87 4.4.4,地址的强制转换.........................................88 4.5,多维数组与多级指针............................................90 4.5.1,二维数组.....................................................91 4.5.1.1,假想中的二维数组布局................. 91 4.5.1.2,内存与尺子的对比..........................91 4.5.1.3,&p[4][2] - &a[4][2]的值为多少?. 92 4.5.2,二级指针.....................................................93 4.5.2.1,二级指针的内存布局..................... 93 4.6,数组参数与指针参数............................................94 4.6.1,一维数组参数.............................................94 4.6.1.1,能否向函数传递一个数组?......... 94 4.6.1.2,无法向函数传递一个数组............. 96 4.6.2,一级指针参数.............................................97 4.6.2.1,能否把指针变量本身传递给一个函数................................................... 97 4.6.2.2,无法把指针变量本身传递给一个函数................................................... 98 4.6.3,二维数组参数与二维指针参数................ 99 4.7,函数指针....100 4.7.1,函数指针的定义.......................................100 4.7.2,函数指针的使用.......................................101 4.7.2.1,函数指针使用的例子................... 101 4.2.7.2,*(int*)&p ----这是什么?............. 102 4.7.3,(*(void(*) ())0)()------这是什么?...........102 4.7.4,函数指针数组...........................................103 4.7.5,函数指针数组的指针...............................104 第五章 内存管理.......107 5.1,什么是野指针......................................................107 5.2,栈、堆和静态区..................................................107 5.3,常见的内存错误及对策......................................108 5.3.1,指针没有指向一块合法的内存.............. 108 5.3.1.1,结构体成员指针未初始化........... 108 5.3.1.2,没有为结构体指针分配足够的内存..................................................... 109 5.3.1.3,函数的入口校验............................109 5.3.2,为指针分配的内存太小...........................110 5.3.3,内存分配成功,但并未初始化...............110 5.3.4,内存越界................................................... 111 5.3.5,内存泄漏................................................... 111 5.3.5.1,告老还乡求良田............................112 5.3.5.2,如何使用 malloc函数...................112 5.3.5.3,用 malloc函数申请 0字节内存...113 5.3.5.4,内存释放........................................113 5.3.5.5,内存释放之后................................114 5.3.6,内存已经被释放了,但是继续通过指针来使用............................................ 114 第六章 函数............... 115 6.1,函数的由来与好处..............................................116 6.2,编码风格.... 116 6.2,函数设计的一般原则和技巧.................................121 6.4,函数递归....123 6.4.1,一个简单但易出错的递归例子.............. 123 6.4.2,不使用任何变量编写strlen函数............124 第七章 文件结构.....127 7.1,文件内容的一般规则..........................................127 7.2,文件名命名的规则..............................................130
47KB
C语言extern使用方法总结.doc
2010-10-15C语言extern使用方法总结,简单总结,请指教!
4KB
extern用法详解extern用法详解extern用法详解extern用法详解
2008-11-20extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解extern用法详解
21KB
C语言中extern关键字详解.docx
2011-09-14C语言中extern关键字详解.docx ,C语言中extern关键字详解.docx
936KB
MCP2517FD-External-CAN-FD-Controller-with-SPI-Inte.pdf
2019-06-14MCP2517FD-External-CAN-FD-Controller 技术文档
6.47MB
密码智能卡实验平台(VB编写,全面可靠)
2010-03-29CRWICC.H 2002-03-11 Version 2.20 适用读写器: USB接口读写器 适用操作系统: Windows 9X(Me) Windows 2000 环境 适用IC卡 : 符合ISO 7816-1 2 3 4的CPU卡(T=0、1) ------------------------------------------------------------------------------------*/ #include <windows.h> #ifdef __cplusplus extern "C"{ #endif /*------------------------------------------------------------------------------------- 一 基本接口函数 注: 后缀为"C"的同名函数用于Visual Basic环境下调用 --------------------------------------------------------------------------------------- 1. 打开USB读写器 */ HANDLE WINAPI CT_open(char* name); /* name USB端口名 "USB1" "USB2" ... 返回: 小于0为打开端口失败; 大于0为成功的打开的端口描述符,用于读写卡操作函数的fd --------------------------------------------------------------------------------------- 2. 关闭与IC卡读写器相连的串行口(必需用CT_open打开的端口 */ int WINAPI CT_close(HANDLE fd); /* 参数: fd为函数CT_open 所返回的端口描述符. 返回: -1为失败 0为成功. --------------------------------------------------------------------------------------- 3. 对IC卡读写器复位 */ unsigned WINAPI CT_reset(HANDLE fd); /* 参数: fd已打开的端口描述符. 返回: 对USB读写器返回0x9000 说明: 此函数为兼容以前版本而保留,对USB读卡器不需调用此函数 -------------------------------------------------------------------------------------- 4. 对IC卡复位 */ unsigned WINAPI ICC_reset(HANDLE fd,unsigned char *len, unsigned char *resp); unsigned WINAPI ICC_resetC(HANDLE fd,unsigned char *len, unsigned char *resp); /* 参数: fd :已打开的端口描述符. len :为对IC卡复位所返回的复位数据的长度 resp :为复位的数据结果 返回: 0x9000 成功 0x6200 无卡 0x6201 协议不认识 0xffff 通迅失败 ---------------------------------------------------------------------可供密码卡实验操作
5.22MB
Addison.Wesley.C++.by.Dissection.2002.pdf
2008-04-161 Writing an ANSI C++ Program 1 1.1 Getting Ready to Program....... 2 1.1 A First Program......... 3 1.2 Problem Solving: Recipes....... . 7 1.2.1 Algorithms—Being Precise...... . . 8 1.3 Implementing Our Algorithm in C++.... . . . 10 1.4 Software Engineering: Style...... . . 12 1.5 Common Programming Errors...... 13 1.6 Writing and Running a C++ Program.... . . . 14 1.6.1 Interrupting a Program...... 16 1.6.2 Typing an End-of-File Signal..... 16 1.7 Dr. P’s Prescriptions....... . . . 16 1.8 C++ Compared with Java....... 17 Summary.......... 20 Review Questions........ . 21 Exercises.......... 22 2 Native Types and Statements 25 2.1 Program Elements........ . 26 2.1.1 Comments........ . 26 2.1.2 Keywords........ . . 27 2.1.3 Identifiers........ . . 27 2.1.4 Literals......... 29 2.1.5 Operators and Punctuators..... . 31 2.2 Input/Output......... . 31 2.3 Program Structure........ . 34 2.3.1 Redirection........ . 36 2.4 Simple Types......... . 37 2.4.1 Initialization........ 39 2.5 The Traditional Conversions...... . 40 2.6 Enumeration Types........ 43 2.6.1 typedef Declarations...... . 44 2.7 Expressions.......... . 44 2.7.1 Precedence and Associativity of Operators.. . 45 2.7.2 Relational, Equality, and Logical Operators.. . 47 2.8 Statements......... . . 50 2.8.1 Assignment and Expressions..... . . . 51 2.8.2 The Compound Statement...... . 52 2.8.3 The if and if-else Statements.... . 52 2.8.4 The while Statement...... . 55 2.8.5 The for Statement...... . . . 56 2.8.6 The do Statement....... 57 2.8.7 The break and continue Statements... . 58 2.8.8 The switch Statement...... 59 2.8.9 The goto Statement...... . . 62 2.9 Software Engineering: Debugging..... . 62 2.10 Dr. P’s Prescriptions....... . . . 65 2.11 C++ Compared with Java....... 67 Summary.......... 69 Review Questions........ . 70 Exercises.......... 71 3 Functions, Pointers, and Arrays 75 3.1 Functions......... . . . 75 3.2 Function Invocation........ 76 3.3 Function Definition........ 78 3.4 The return Statement........ . 79 3.5 Function Prototypes........ . . . 80 3.6 Call-By-Value......... . 81 3.7 Recursion......... . . . 83 3.8 Default Arguments........ 84 3.9 Functions as Arguments....... 86 3.10 Overloading Functions........ . 88 3.11 Inlining.......... . 89 3.11.1Software Engineering: Avoiding Macros... 89 3.12 Scope and Storage Class....... 90 3.12.1The Storage Class auto...... . . . 92 3.12.2The Storage Class extern..... . . 92 3.12.3The Storage Class register..... 93 3.12.4The Storage Class static..... . . 94 3.12.5Header Files and Linkage Mysteries... . . . 95 3.13 Namespaces......... . 98 3.14 Pointer Types......... 99 3.14.1Addressing and Dereferencing.... . 100 3.14.2Pointer-Based Call-By-Reference..... 100 3.15 Reference Declarations....... 102 3.16 The Uses of void......... 104 3.17 Arrays.......... . 105 3.17.1Subscripting....... . . . 106 3.17.2 Initialization....... . . . 106 3.18 Arrays and Pointers....... . . . 106 3.19 Passing Arrays to Functions....... 107 3.20 Problem Solving: Random Numbers.... . . . 108 3.21 Software Engineering: Structured Programming.. . . 111 3.22 Core Language ADT: char* String..... 114 3.23 Multidimensional Arrays...... . . . 117 3.24 Operators new and delete...... . 120 3.24.1 Vector Instead of Array..... . . . 123 3.24.2 String Instead of char*..... . . . 124 3.25 Software Engineering: Program Correctness.... 124 3.26 Dr. P’s Prescriptions....... . . 127 3.27 C++ Compared with Java...... . . . 128 Summary......... . . . 130 Review Questions........ 132 Exercises......... . . . 133 4 Classes and Abstract Data Types 139 4.1 The Aggregate Type class and struct.... . . . 140 4.2 Member Selection Operator...... . 141 4.3 Member Functions........ . . . 143 4.4 Access: Private and Public...... . . 146 4.5 Classes.......... 147 4.6 Class Scope......... . 150 4.6.1 Scope Resolution Operator..... 150 4.6.2 Nested Classes....... . 152 4.7 An Example: Flushing....... . 153 4.8 The this Pointer........ . 158 4.9 static Members......... 159 4.10 const Members......... . 161 4.10.1Mutable Members...... . . . 163 4.11 A Container Class Example: ch_stack..... 164 4.12 Software Engineering: Class Design.... . . . 166 4.12.1Trade-Offs in Design...... . 168 4.12.2Unified Modeling Language (UML) and Design. . . 169 4.13 Dr. P’s Prescriptions....... . . 170 4.14 C++ Compared with Java...... . . . 171 4.15 Advanced Topics........ . 172 4.15.1Pointer to Class Member..... . . 172 4.15.2Unions........ . . . 174 4.15.3Bit Fields........ . . 175 Summary......... . . . 177 Review Questions........ 178 Exercises......... . . . 179 5 Ctors, Dtors, Conversions, and Operator Overloading 183 5.1 Classes with Constructors...... . . 184 5.1.1 The Default Constructor..... . . 186 5.1.2 Constructor Initializer...... 187 5.1.3 Constructors as Conversions..... . . 187 5.1.4 Improving the point Class..... 189 5.1.5 Constructing a Stack...... . 190 5.1.6 The Copy Constructor...... 193 5.2 Classes with Destructors...... . . . 195 5.3 Members That Are Class Types..... . . 195 5.4 Example: A Singly Linked List..... . . . 196 5.5 Strings Using Reference Semantics.... . . . 201 5.6 Constructor Issues and Mysteries..... 204 5.6.1 Destructor Details...... . . . 205 5.6.2 Constructor Pragmatics...... . . 206 5.7 Polymorphism Using Function Overloading... . 206 5.8 ADT Conversions......... 207 5.9 Overloading and Signature Matching.... . . 208 5.10 Friend Functions........ . 211 5.11 Overloading Operators....... 213 5.12 Unary Operator Overloading...... 214 5.13 Binary Operator Overloading...... 217 5.14 Overloading the Assignment Operator.... . 219 5.15 Overloading the Subscript Operator..... . . 220 5.16 Overloading Operator () for Indexing.... 221 5.17 Overloading << and >>....... 222 5.18 Overloading ->........ . . 223 5.19 Overloading new and delete...... . . . 224 5.20 More Signature Matching....... . . 227 5.21 Software Engineering: When to Use Overloading.. . 228 5.22 Dr. P’s Prescriptions....... . . 229 5.23 C++ Compared with Java...... . . . 231 Summary......... . . . 235 Review Questions........ 236 Exercises......... . . . 237 6 Templates and Generic Programming 243 6.1 Template Class stack....... . 246 6.2 Function Templates....... . . . 248 6.2.1 Signature Matching and Overloading.... 250 6.2.2 How to Write a Simple Function: square().. . . . 252 6.3 Generic Code Development: Quicksort..... 253 6.3.1 Converting to a Generic quicksort()... . . . 256 6.4 Class Templates........ . 260 6.4.1 Friends........ . . . 260 6.4.2 Static Members....... . 260 6.4.3 Class Template Arguments..... 261 6.4.4 Default Template Arguments..... . . 261 6.4.5 Member Templates...... . . 262 6.5 Parameterizing the Class vector...... 262 6.6 Using STL: string, vector, and complex... . . 265 6.6.1 string and basic_string<>.... . . . 265 6.6.2 vector<> in STL....... 267 6.6.3 Using complex<>...... . . . 267 6.6.4 limits and Other Useful Templates.... . . 268 6.7 Software Engineering: Reuse and Generics.... . 269 6.7.1 Debugging Template Code..... 269 6.7.2 Special Considerations..... . . . 270 6.7.3 Using typename....... 271 6.8 Dr. P’s Prescriptions....... . . 272 6.9 C++ Compared with Java...... . . . 272 Summary......... . . . 276 Review Questions........ 277 Exercises......... . . . 278 7 Standard Template Library 280 7.1 A Simple STL Example....... . 280 7.2 Containers.......... . 283 7.2.1 Sequence Containers....... 285 7.2.2 Associative Containers..... . . . 288 7.2.3 Container Adaptors...... . . 293 7.3 Iterators......... . . . 296 7.3.1 Iterators for istream and ostream... . . . 297 7.3.2 Iterator Adaptors....... . . . 300 7.4 Algorithms......... . 302 7.4.1 Sorting Algorithms...... . . 302 7.4.2 Nonmutating Sequence Algorithms... . . 305 7.4.3 Mutating Sequence Algorithms.... . 307 7.4.4 Numerical Algorithms...... 310 7.5 Numerical Integration Made Easy..... . 311 7.6 STL: Function Objects....... . 315 7.6.1 Building a Function Object..... 317 7.6.2 Function Adaptors....... . . 318 7.7 Allocators......... . . 320 7.8 Software Engineering: STL Use...... . . 320 7.8.1 Syntax Bugs....... . . . 321 7.9 Dr. P’s Prescriptions....... . . 322 7.10 C++ Compared with Java...... . . . 323 Summary......... . . . 324 Review Questions........ 325 Exercises......... . . . 326 8 Inheritance and OOP 328 8.1 A Derived Class........ . . 329 8.1.1 More Unified Modeling Language (UML)... . . 333 8.2 A Student ISA Person....... . . 334 8.3 Virtual Functions: Dynamic Determination... . . 337 8.3.1 Overloading and Overriding Confusion.. . . . 340 8.3.2 A Canonical Example: Class shape... . . 342 8.4 Abstract Base Classes....... . 343 8.5 Templates and Inheritance....... . 350 8.6 Multiple Inheritance........ . . 351 8.7 RTTI and Other Fine Points...... . 353 8.7.1 Finer Points........ 354 8.8 Software Engineering: Inheritance and Design.. . . . 355 8.8.1 Subtyping Form........ 356 8.8.2 Code Reuse........ . . . 357 8.9 Dr. P’s Prescriptions....... . . 358 8.10 C++ Compared with Java...... . . . 358 Summary......... . . . 361 Review Questions........ 362 Exercises......... . . . 363 9 Input/Output 366 9.1 The Output Class ostream....... . 366 9.2 Formatted Output and iomanip..... . . 367 9.3 User-Defined Types: Output....... 372 9.4 The Input Class istream....... . . . 374 9.5 Files.......... . . 375 9.6 Using Strings as Streams...... . . . 379 9.7 The Functions and Macros in ctype.... . . . 380 9.8 Using Stream States........ . . 380 9.9 Mixing I/O Libraries........ . . 383 9.10 Software Engineering: I/O...... . . 384 9.11 Dr. P’s Prescriptions....... . . 386 9.12 C++ Compared with Java...... . . . 386 Summary......... . . . 389 Review Questions........ 390 Exercises......... . . . 391 10Exceptions and Program Correctness 394 10.1 Using the assert Library....... . . . 394 10.2 C++ Exceptions........ . . 397 10.3 Throwing Exceptions....... . . 398 10.3.1Rethrown Exceptions....... 400 10.3.2Exception Expressions..... . . . 401 10.4 try Blocks.......... . 404 10.5 Handlers......... . . . 405 10.6 Converting Assertions to Exceptions.... . . 405 10.7 Exception Specification....... 408 10.8 terminate() and unexpected()..... 409 10.9 Standard Exceptions and Their Uses.... . . 409 10.10 Software Engineering: Exception Objects... . . . 411 10.11 Dr. P’s Prescriptions....... . . 413 10.12 C++ Compared with Java...... . . . 414 Summary......... . . . 417 Review Questions........ 418 Exercises......... . . . 419 11OOP Using C++ 421 11.1 OOP Language Requirements...... . . . 422 11.1.1ADTs: Encapsulation and Data Hiding... 423 11.1.2Reuse and Inheritance...... 423 11.1.3Polymorphism........ . 424 11.2 OOP: The Dominant Programming Methodology.. . 425 11.3 Designing with OOP in Mind...... 432 11.4 Class-Responsibility-Collaborator...... 434 11.4.1CRC Cards......... 435 11.5 Design Patterns........ . . 436 11.6 A Further Assessment of C++..... . . . 437 11.6.1Why C++ Is Better Than Java.... . . . 438 11.6.2A Short Rebuttal....... 439 11.7 Software Engineering: Last Thoughts.... . . 439 11.8 Dr. P’s Prescriptions....... . . 440 11.9 C++ Compared with Java...... . . . 441 Summary......... . . . 447 Review Questions........ 448 Exercises......... . . . 449 AASCII Character Codes 451 B Operator Precedence and Associativity 453 C String Library 455 C.1 Constructors......... 456 C.2 Member Functions........ . . . 457 C.3 Global Operators........ . 460 DThe tio Library 462 D.1 Console.......... . . . 462 D.2 FormattedWriter........ . 463 D.3 PrintFileWriter........ . . . 472 D.4 ReadException......... . . 472 D.5 ReadInput......... . . 473 Index 482
3.79MB
CellCounter-WPF-master-master.zip
2020-10-03[DllImport(DEEP_LEARNING_LIBRARY_DLL_GPU_VERSION, EntryPoint = "init")] internal static extern int InitializeNetInGpu(string configurationFilename, string weightsFilename, int gpu); [DllImport(DEEP_LEARNING_LIBRARY_DLL_GPU_VERSION, EntryPoint = "detect_image")] internal sta
3.26MB
Turbo C++ 3.0[DISK]
2012-08-05Welcome to Turbo C++ Version 3.0 -------------------------------- This README file contains important information about Turbo C++. For the latest information about Turbo C++ and its accompanying programs and manuals, read this file in its entirety. TABLE OF CONTENTS ----------------- 1. How to Get Help 2. Installation 3. Features 4. Important Information 5. Testing Your Expanded Memory 6. Corrections to the On-line Help 1. HOW TO GET HELP ------------------- If you have any problems, please read this file, the HELPME!.DOC and other files in your DOC subdirectory, and the Turbo C++ manuals first. If you still have a question and need assistance, help is available from the following sources: 1. Type GO BPROGB on the CompuServe bulletin board system for instant access to the Borland forums with their libraries of technical information and answers to common questions. If you are not a member of CompuServe, see the enclosed special offer, and write for full details on how to receive a free IntroPak containing a $15 credit toward your first month's on-line charges. 2. Check with your local software dealer or users' group. 3. Borland's TECHFAX service. Call (800) 822-4269 for a FAX catalog of entries. 4. If you have an urgent problem that cannot wait and you have sent in the license agreement that came with the package, you may call the Borland Technical Support Department at (408) 438-5300. Please have the following information ready before calling: a. Product name and serial number on your original distribution disk. Please have your serial number ready or we will be unable to process your call. b. Product version number. The version number for Turbo C++ can be displayed by pressing Alt-H/A. c. Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can be determined by typing VER at the DOS prompt.) e. Contents of your AUTOEXEC.BAT file. f. Contents of your CONFIG.SYS file. 2. INSTALLATION ---------------- You MUST use the INSTALL program to install Turbo C++. The files on the distribution disks are all archived and have to be properly assembled. You cannot do this by hand! IMPORTANT! If you want to create backup copies of your disks, make sure that you put the backup on the same type of disk as the source. If you're backing up the 5 1/4 inch 1.2 Mb disk set, use only blank 5 1/4 inch 1.2 Mb disks for backup, etc. The installation will not work correctly if you do not use the same media type for the backup disks. To start the installation, change your current drive to the one that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each prompt. For example, if you will be installing from drive A:, type: A: INSTALL - This INSTALL handles the installation of both the compiler and tools in one operation, and allows several new configuration options. - After installation, make sure you insert \TC\BIN - or whatever you selected as your BIN directory - into your DOS path so the executable files can be found. - Note: The list of files is contained in a separate file called FILELIST.DOC, which will appear in the target directory you specify during installation. - After your initial installation, you can run INSTALL again to add elements you omitted the first time. Just select the items you want to add in the INSTALL options screen. Because some things you may want to save could be overwritten, review the following items to make sure you don't lose important information: 1. Selecting CMD (the Command-line compiler) causes an overwrite of any existing turboc.cfg & tlink.cfg file with path information provided in that INSTALL session. Any switches other than -L (library path) and -I (include path) will not be preserved. 2. Selecting IDE will reset the include and library paths to those provided in that INSTALL session. 3. By selecting any one of the following, the help file paths and choices for THELP.CFG will reflect the current session's installation choices: a. CMD - command-line compiler b. IDE - integrated environment 4. Alterations to headers or startup files will be overwritten if any library models are selected. In general, any selection you make of something installed earlier will cause an overwrite of the earlier version without prompting. You should read the rest of this README file to get further information about this release before you do the installation. 3. FEATURES ------------ Turbo C++ 3.0 includes big speed and capacity gains. Here are some important features found in this version: - DPMI services for increased capacity - C++ 2.1 support, including the new nested class specifications, and support of C++ 3.0 templates. - Support for pre-compiled headers for substantial time savings during subsequent recompiles. - Color syntax highlighting - Unlimited Undo/Redo replacing previous 'restore line' capability - Added library functions for compatibility with other runtime libraries, and addition of support for long double parameters in math functions. (Please refer to On-line Help for details.) - New MAKE features. (Please see the MAKE chapter in the User's Guide for details.) - Added BGI (Borland Graphics Interface) fonts and support. (See "New BGI fonts" below.) - A resident DPMI kernel program, DPMIRES.EXE. (See "DPMI" below.) - THELP now allows you to switch between help files without unloading and reloading. (Please see UTIL.DOC for details.) NEW BGI FONTS ------------- Several new fonts have been added to the Borland Graphics Interface: Name Value Description ------------------------------------------- SCRIPT_FONT 5 Stroked script font SIMPLEX_FONT 6 Stroked simplex font TRIP_SCR_FONT 7 Stroked triplex script font COMPLEX_FONT 8 Stroked complex font EURO_FONT 9 Stroked European font BOLD_FONT 10 Stroked bold font The fonts in the BGI now support the full ASCII character set. DPMI ---- TC.EXE, TCC.EXE, and TLINK.EXE are now hosted under DPMI. These files support protected-mode compilation and replace the files of the same name in Turbo C++ Second Edition. Turbo C++ Second Edition should continue to be used in instances where real-mode compilation is desired. If you encounter a "machine not in database" message while attempting to run the compiler, run the DPMIINST program to add your machine configuration to the DPMI server database. This version includes a resident DPMI host program, DPMIRES.EXE, that allows you to preload the server before invoking TC, TCC, or any other DPMI-hosted executables. If you want to run such hosted EXEs in a Windows Standard Mode DOS window, you should run DPMIRES.EXE before loading Windows. To do this, enter the following commands at DOS: set DPMIMEM=MAXMEM 2000 dpmires win /s If you want to limit the amount of extended memory used by the DPMI-hosted executables, an environment variable called DPMIMEM can be set to do so. For instance, the command set DPMIMEM=MAXMEM 2000 reserves about 2 Mb of memory for DPMIRES. The number after MAXMEM can be adjusted, but cannot be lower than 1000. The hosted executables cannot spawn each other when SHARE is loaded. For instance, if you run MAKE on a file which in turn calls MAKE again, you will get a sharing violation. In this specific case, you can call the real mode version, MAKER, within the given makefile, and a sharing violation won't occur. 4. IMPORTANT INFORMATION ------------------------- - When using Brief with THELP, make sure to use Brief's -p switch to ensure that the thelp window will be visible. - We recommend that you use the following mouse drivers with this product: Microsoft Mouse version 7.04 or later; Logitech Mouse version 5.01 or later; Genius Mouse version 9.06 or later. - If you get a "floating point formats not linked" message at runtime, put the following somewhere in your source files: extern void _floatconvert(); #pragma extref _floatconvert This will force inclusion of floating point formats, which may not be linked to reduce executable size. COMPILER - The default extension for source files to the command-line compiler is .CPP; that is, if you enter TCC -c test the compiler will search for test.cpp, and give an error if a file of that name cannot be found. If you want to have the command-line compiler assume a .c extension and C language source, use the command-line option -P-c. For more information, see "The command-line compiler" in the User's Guide. - Note that the Generate COMDEFs choice under Options|Compiler|Advanced Code Generation and the -Fc command- line option are only supported in the C language. Linker errors will result if you attempt to use a communal variable in C++. - The macros min() and max() are not defined when stdlib.h is compiled as C++ (to allow their use in 3rd party libraries, etc.). - Note that SYMDEB creates .SYM files for use in debugging; Turbo C++ creates .SYM files for pre-compiled headers. They are not compatible and collisions should be avoided by setting the name of the pre-compiled header file (using - H=filename). - There is now full support of distance modifiers (near and far) used for class member pointers. Here are two sample declarations and their meanings: void (A::* far var) (); this is a far variable 'var' of type 'void (A::*)()'; void (far A::* var) (); this is a 'default distance' variable 'var' of type 'void (far A::*)()' - If you use C++ templates, and use a separate TLINK command line rather than letting TCC invoke TLINK, you should make sure that you turn on case-sensitive links with the /c switch. - Incorrect code will be generated if you have a statement of the type "A op B" where either A or B is an enum and the other operand is a long, and "op" is one of the following operators: += -= *= /= | ^ The same problem applies when the operands are a non-integer enum and an int. Cast the enum to long or int respectively to solve the problem. IDE - When debugging a mouse application the Options|Debugger|Display Swapping option should be set to "Always" for best results. - In the IDE, the mouse cursor is turned off during compilation for performance improvements. - To run or debug an overlaid application in the IDE when DOS SHARE is loaded, the .EXE file must first be marked as read-only. Otherwise, unload SHARE. - Pressing Control-Break twice while running or stepping a program from the IDE may cause unexpected results. In particular, avoid pressing Control-Break twice in response to any function requiring input (scanf, getch, etc.). To break out of a program during such interaction, press Control-Break and enter a valid input string. Control will be returned to the IDE. EXAMPLE PROGRAMS - When you are running any example programs that come with .PRJ files, if you didn't use the standard directories when you installed Turbo C++ you will have to change the .PRJ file to reflect your actual directory setup. Do this from inside Turbo C++ with Alt-O/D. LINKING C++ WITH C - Linking C++ modules with C modules requires the use of a linkage specification. Prototypes for C functions within C++ modules must be in one of the following forms: extern "C" declaration extern "C" { declarations } For example, if a C module contains these functions: char *SCopy(char*, char*); void ClearScreen(void) they must be declared in a C++ module in one of the following ways: extern "C" char *SCopy(char*, char*); extern "C" void ClearScreen(void); or extern "C" { char *SCopy(char*, char*); void ClearScreen(void); } Failure to do so will result in "Undefined symbol" errors during link. For further examples, see the standard header files. CLASS LIBRARY - Two versions of the class libraries are provided; one that includes debug information and one that does not. Small versions of each are provided, and project files are provided to build other models. Note that the non-debug versions are used by default. If you would like to use the debug version, copy it to the non-debug file. For instance, in the CLASSLIB\LIB directory, copy TCLASDBS.LIB to TCLASSS.LIB for the small model version. - In some places the User's Guide incorrectly refers to the online documentation for the Container Class Libraries as CONTAIN.DOC. The correct file name is CLASSLIB.DOC, located in the ..\DOC directory. 5. TESTING YOUR EXPANDED MEMORY: EMSTEST.COM --------------------------------------------- Included with Turbo C++ is a program to test your Expanded Memory hardware and software. If you have problems using Turbo C++ with your EMS, type EMSTEST at the DOS prompt and follow the instructions. 6. CORRECTIONS TO THE ON-LINE HELP ----------------------------------- The information for alloca is not available in on-line help. The correct help screen should read as follows: ------------------------------------------------------------------ Function: alloca Allocates temporary stack space Syntax: #include <malloc.h> void *alloca(size_t size); Remarks: alloca allocates bytes on the stack. The allocated space is automatically freed up when the calling function exits. Return value: o On success (if enough stack space is available), returns a pointer to the allocated stack area. o On error, returns null. Argument size is the number of bytes allocated on the stack. Because alloca modifies the stack pointer, do no place calls to alloca in an expression that is an argument to a function. NOTE: If the calling function does not contain any references to local variables in the stack, the stack won't be resotored correctly when the function exits and your program will crash. To ensure that the stack is restored correctly, use this code in your calling function: char *p; char dummy[1]; dummy[0] := 0;; ... p = alloca(nbytes); Because alloca is not defined in ANSI C, you should use malloc instead. See also: malloc ------------------------------------------------------------------
3.26MB
Turbo C++ 3.00[DISK]
2012-08-05Welcome to Turbo C++ Version 3.0 -------------------------------- This README file contains important information about Turbo C++. For the latest information about Turbo C++ and its accompanying programs and manuals, read this file in its entirety. TABLE OF CONTENTS ----------------- 1. How to Get Help 2. Installation 3. Features 4. Important Information 5. Testing Your Expanded Memory 6. Corrections to the On-line Help 1. HOW TO GET HELP ------------------- If you have any problems, please read this file, the HELPME!.DOC and other files in your DOC subdirectory, and the Turbo C++ manuals first. If you still have a question and need assistance, help is available from the following sources: 1. Type GO BPROGB on the CompuServe bulletin board system for instant access to the Borland forums with their libraries of technical information and answers to common questions. If you are not a member of CompuServe, see the enclosed special offer, and write for full details on how to receive a free IntroPak containing a $15 credit toward your first month's on-line charges. 2. Check with your local software dealer or users' group. 3. Borland's TECHFAX service. Call (800) 822-4269 for a FAX catalog of entries. 4. If you have an urgent problem that cannot wait and you have sent in the license agreement that came with the package, you may call the Borland Technical Support Department at (408) 438-5300. Please have the following information ready before calling: a. Product name and serial number on your original distribution disk. Please have your serial number ready or we will be unable to process your call. b. Product version number. The version number for Turbo C++ can be displayed by pressing Alt-H/A. c. Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can be determined by typing VER at the DOS prompt.) e. Contents of your AUTOEXEC.BAT file. f. Contents of your CONFIG.SYS file. 2. INSTALLATION ---------------- You MUST use the INSTALL program to install Turbo C++. The files on the distribution disks are all archived and have to be properly assembled. You cannot do this by hand! IMPORTANT! If you want to create backup copies of your disks, make sure that you put the backup on the same type of disk as the source. If you're backing up the 5 1/4 inch 1.2 Mb disk set, use only blank 5 1/4 inch 1.2 Mb disks for backup, etc. The installation will not work correctly if you do not use the same media type for the backup disks. To start the installation, change your current drive to the one that has the install program on it and type INSTALL. You will be given instructions in a box at the bottom of the screen for each prompt. For example, if you will be installing from drive A:, type: A: INSTALL - This INSTALL handles the installation of both the compiler and tools in one operation, and allows several new configuration options. - After installation, make sure you insert \TC\BIN - or whatever you selected as your BIN directory - into your DOS path so the executable files can be found. - Note: The list of files is contained in a separate file called FILELIST.DOC, which will appear in the target directory you specify during installation. - After your initial installation, you can run INSTALL again to add elements you omitted the first time. Just select the items you want to add in the INSTALL options screen. Because some things you may want to save could be overwritten, review the following items to make sure you don't lose important information: 1. Selecting CMD (the Command-line compiler) causes an overwrite of any existing turboc.cfg & tlink.cfg file with path information provided in that INSTALL session. Any switches other than -L (library path) and -I (include path) will not be preserved. 2. Selecting IDE will reset the include and library paths to those provided in that INSTALL session. 3. By selecting any one of the following, the help file paths and choices for THELP.CFG will reflect the current session's installation choices: a. CMD - command-line compiler b. IDE - integrated environment 4. Alterations to headers or startup files will be overwritten if any library models are selected. In general, any selection you make of something installed earlier will cause an overwrite of the earlier version without prompting. You should read the rest of this README file to get further information about this release before you do the installation. 3. FEATURES ------------ Turbo C++ 3.0 includes big speed and capacity gains. Here are some important features found in this version: - DPMI services for increased capacity - C++ 2.1 support, including the new nested class specifications, and support of C++ 3.0 templates. - Support for pre-compiled headers for substantial time savings during subsequent recompiles. - Color syntax highlighting - Unlimited Undo/Redo replacing previous 'restore line' capability - Added library functions for compatibility with other runtime libraries, and addition of support for long double parameters in math functions. (Please refer to On-line Help for details.) - New MAKE features. (Please see the MAKE chapter in the User's Guide for details.) - Added BGI (Borland Graphics Interface) fonts and support. (See "New BGI fonts" below.) - A resident DPMI kernel program, DPMIRES.EXE. (See "DPMI" below.) - THELP now allows you to switch between help files without unloading and reloading. (Please see UTIL.DOC for details.) NEW BGI FONTS ------------- Several new fonts have been added to the Borland Graphics Interface: Name Value Description ------------------------------------------- SCRIPT_FONT 5 Stroked script font SIMPLEX_FONT 6 Stroked simplex font TRIP_SCR_FONT 7 Stroked triplex script font COMPLEX_FONT 8 Stroked complex font EURO_FONT 9 Stroked European font BOLD_FONT 10 Stroked bold font The fonts in the BGI now support the full ASCII character set. DPMI ---- TC.EXE, TCC.EXE, and TLINK.EXE are now hosted under DPMI. These files support protected-mode compilation and replace the files of the same name in Turbo C++ Second Edition. Turbo C++ Second Edition should continue to be used in instances where real-mode compilation is desired. If you encounter a "machine not in database" message while attempting to run the compiler, run the DPMIINST program to add your machine configuration to the DPMI server database. This version includes a resident DPMI host program, DPMIRES.EXE, that allows you to preload the server before invoking TC, TCC, or any other DPMI-hosted executables. If you want to run such hosted EXEs in a Windows Standard Mode DOS window, you should run DPMIRES.EXE before loading Windows. To do this, enter the following commands at DOS: set DPMIMEM=MAXMEM 2000 dpmires win /s If you want to limit the amount of extended memory used by the DPMI-hosted executables, an environment variable called DPMIMEM can be set to do so. For instance, the command set DPMIMEM=MAXMEM 2000 reserves about 2 Mb of memory for DPMIRES. The number after MAXMEM can be adjusted, but cannot be lower than 1000. The hosted executables cannot spawn each other when SHARE is loaded. For instance, if you run MAKE on a file which in turn calls MAKE again, you will get a sharing violation. In this specific case, you can call the real mode version, MAKER, within the given makefile, and a sharing violation won't occur. 4. IMPORTANT INFORMATION ------------------------- - When using Brief with THELP, make sure to use Brief's -p switch to ensure that the thelp window will be visible. - We recommend that you use the following mouse drivers with this product: Microsoft Mouse version 7.04 or later; Logitech Mouse version 5.01 or later; Genius Mouse version 9.06 or later. - If you get a "floating point formats not linked" message at runtime, put the following somewhere in your source files: extern void _floatconvert(); #pragma extref _floatconvert This will force inclusion of floating point formats, which may not be linked to reduce executable size. COMPILER - The default extension for source files to the command-line compiler is .CPP; that is, if you enter TCC -c test the compiler will search for test.cpp, and give an error if a file of that name cannot be found. If you want to have the command-line compiler assume a .c extension and C language source, use the command-line option -P-c. For more information, see "The command-line compiler" in the User's Guide. - Note that the Generate COMDEFs choice under Options|Compiler|Advanced Code Generation and the -Fc command- line option are only supported in the C language. Linker errors will result if you attempt to use a communal variable in C++. - The macros min() and max() are not defined when stdlib.h is compiled as C++ (to allow their use in 3rd party libraries, etc.). - Note that SYMDEB creates .SYM files for use in debugging; Turbo C++ creates .SYM files for pre-compiled headers. They are not compatible and collisions should be avoided by setting the name of the pre-compiled header file (using - H=filename). - There is now full support of distance modifiers (near and far) used for class member pointers. Here are two sample declarations and their meanings: void (A::* far var) (); this is a far variable 'var' of type 'void (A::*)()'; void (far A::* var) (); this is a 'default distance' variable 'var' of type 'void (far A::*)()' - If you use C++ templates, and use a separate TLINK command line rather than letting TCC invoke TLINK, you should make sure that you turn on case-sensitive links with the /c switch. - Incorrect code will be generated if you have a statement of the type "A op B" where either A or B is an enum and the other operand is a long, and "op" is one of the following operators: += -= *= /= | ^ The same problem applies when the operands are a non-integer enum and an int. Cast the enum to long or int respectively to solve the problem. IDE - When debugging a mouse application the Options|Debugger|Display Swapping option should be set to "Always" for best results. - In the IDE, the mouse cursor is turned off during compilation for performance improvements. - To run or debug an overlaid application in the IDE when DOS SHARE is loaded, the .EXE file must first be marked as read-only. Otherwise, unload SHARE. - Pressing Control-Break twice while running or stepping a program from the IDE may cause unexpected results. In particular, avoid pressing Control-Break twice in response to any function requiring input (scanf, getch, etc.). To break out of a program during such interaction, press Control-Break and enter a valid input string. Control will be returned to the IDE. EXAMPLE PROGRAMS - When you are running any example programs that come with .PRJ files, if you didn't use the standard directories when you installed Turbo C++ you will have to change the .PRJ file to reflect your actual directory setup. Do this from inside Turbo C++ with Alt-O/D. LINKING C++ WITH C - Linking C++ modules with C modules requires the use of a linkage specification. Prototypes for C functions within C++ modules must be in one of the following forms: extern "C" declaration extern "C" { declarations } For example, if a C module contains these functions: char *SCopy(char*, char*); void ClearScreen(void) they must be declared in a C++ module in one of the following ways: extern "C" char *SCopy(char*, char*); extern "C" void ClearScreen(void); or extern "C" { char *SCopy(char*, char*); void ClearScreen(void); } Failure to do so will result in "Undefined symbol" errors during link. For further examples, see the standard header files. CLASS LIBRARY - Two versions of the class libraries are provided; one that includes debug information and one that does not. Small versions of each are provided, and project files are provided to build other models. Note that the non-debug versions are used by default. If you would like to use the debug version, copy it to the non-debug file. For instance, in the CLASSLIB\LIB directory, copy TCLASDBS.LIB to TCLASSS.LIB for the small model version. - In some places the User's Guide incorrectly refers to the online documentation for the Container Class Libraries as CONTAIN.DOC. The correct file name is CLASSLIB.DOC, located in the ..\DOC directory. 5. TESTING YOUR EXPANDED MEMORY: EMSTEST.COM --------------------------------------------- Included with Turbo C++ is a program to test your Expanded Memory hardware and software. If you have problems using Turbo C++ with your EMS, type EMSTEST at the DOS prompt and follow the instructions. 6. CORRECTIONS TO THE ON-LINE HELP ----------------------------------- The information for alloca is not available in on-line help. The correct help screen should read as follows: ------------------------------------------------------------------ Function: alloca Allocates temporary stack space Syntax: #include <malloc.h> void *alloca(size_t size); Remarks: alloca allocates bytes on the stack. The allocated space is automatically freed up when the calling function exits. Return value: o On success (if enough stack space is available), returns a pointer to the allocated stack area. o On error, returns null. Argument size is the number of bytes allocated on the stack. Because alloca modifies the stack pointer, do no place calls to alloca in an expression that is an argument to a function. NOTE: If the calling function does not contain any references to local variables in the stack, the stack won't be resotored correctly when the function exits and your program will crash. To ensure that the stack is restored correctly, use this code in your calling function: char *p; char dummy[1]; dummy[0] := 0;; ... p = alloca(nbytes); Because alloca is not defined in ANSI C, you should use malloc instead. See also: malloc ------------------------------------------------------------------
1.68MB
linux jnative 调用.so方法及附属全部库和源码
2012-05-26准备工作: 1.编译JnativeCpp 2.将编译出来的libJNativeCpp.so,拷贝到/usr/lib/,同时执行chmod 555 libJNativeCpp.so 测试过程简介 1.c测试库libtest.so 环境:ubuntu10.4下 语言:c 编译库名称为:libtest.so 涉及文件:so_test.h test_a.c test_b.c test_c.c 终端执行命令:$ gcc test_a.c test_b.c test_c.c -fPIC -shared -o libtest.so 将编译得到到libtest.so拷贝到/usr/lib/,同时执行chmod 555 libtest.so 2.qt测试库libmylib.so 环境:ubuntu10.4下 语言:c 编译工具:qt Creator 编译库名称为:libmylib.so 将编译得到到libmylib.so拷贝到/usr/lib/,同时执行chmod 555 libmylib.so 3.编译环境安装 a.安装jdk 1.6 b.安装netBeans 6.8 c.创建javaApp工程 d.将JNative.jar添加到工程中 e.参考如下代码,编写后编译执行,并运行 import org.xvolks.jnative.JNative; import org.xvolks.jnative.Type; import org.xvolks.jnative.exceptions.NativeException; public class Main { public static void main(String[] args) throws NativeException, IllegalAccessException{ //纯c写到动态库 JNative clib = new JNative("libtest.so", "test_a"); //调用libtest.so下到test_a函数 clib.setRetVal(Type.STRING); //设置此函数的返回值 clib.invoke(); //函数执行 System.out.println(clib.getRetVal());//输出函数返回结果 //qt写到动态库 //以下部分使用qt编译到so,注意在函数声明前加 extern "C" //如extern "C" const char* getLocalHost(); JNative getstring = new JNative("libmylib.so", "getstring"); getstring.setRetVal(Type.STRING); getstring.invoke(); System.out.println(getstring.getRetVal()); } } 4.输出结果 this is in test_a... getstring hello .....
-
下载
2017年中国眼底照相机市场专题调研报告.pdf
2017年中国眼底照相机市场专题调研报告.pdf
-
下载
2017-2022年中国汽车防撞雷达行业分析及未来趋势发展预测报告.pdf
2017-2022年中国汽车防撞雷达行业分析及未来趋势发展预测报告.pdf
-
下载
2017-2022年农业物联网行业市场深度分析及发展前景规划报告.pdf
2017-2022年农业物联网行业市场深度分析及发展前景规划报告.pdf
-
下载
2018-2023年第四方物流行业市场研究及发展前景预测报告.pdf
2018-2023年第四方物流行业市场研究及发展前景预测报告.pdf
-
下载
学校食堂食品安全监管平台建设方案.pptx
学校食堂食品安全监管平台建设方案.pptx
-
下载
2018-2022年中国电子级硅片产品市场专题研究及投资可行性评估报告.pdf
2018-2022年中国电子级硅片产品市场专题研究及投资可行性评估报告.pdf
-
下载
2019-2024年中国火麻油市场现状及投资发展规划报告.pdf
2019-2024年中国火麻油市场现状及投资发展规划报告.pdf
-
下载
2019-2025年中国联合办公行业发展趋势预测与发展战略咨询报告.pdf
2019-2025年中国联合办公行业发展趋势预测与发展战略咨询报告.pdf
-
下载
2020-2025年中国5G行业十四五战略规划制定与实施研究报告.pdf
2020-2025年中国5G行业十四五战略规划制定与实施研究报告.pdf
-
下载
2017-2022年中国亲子装行业市场分析及投资前景预测报告.pdf
2017-2022年中国亲子装行业市场分析及投资前景预测报告.pdf
