我看到的时候正在研究linux C++编程
int execve(const char *path,
char *const argv[],
char *const envp[]);
Run Code Online (Sandbox Code Playgroud)
我不明白是什么char *const argv[]
.我知道char *const foo
是一个指向char的const指针.并且const char *foo
是一个指向const char的指针.但是什么char *const argv[]
?
它是char的const指针数组还是const char的指针数组?
我有一个vector<string>
现在,如何将其转换为char *const argv[]
?
我想在没有命令行参数的情况下在g ++中启用优化.我知道GCC可以通过编写#pragma GCC optimize (2)
代码来实现.但它似乎不适用于G ++.
此页面可能有所帮助:http://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html
我的编译器版本:
$ g++ --version
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
<suppressed copyright message>
$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
<suppressed copyright message>
Run Code Online (Sandbox Code Playgroud)
我像这样编写一些代码:
#pragma GCC optimize (2)
int main(){
long x;
x=11;
x+=12;
x*=13;
x/=14;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
并使用GCC Not G ++编译它.然后我使用objdump,输出
08048300 <main>:
8048300: 55 push %ebp
8048301: 31 c0 xor %eax,%eax
8048303: 89 e5 mov %esp,%ebp
8048305: 5d pop %ebp
8048306: c3 ret
8048307: 90 nop …
Run Code Online (Sandbox Code Playgroud) 我有Ubuntu 14.04LTS.我ghc-7.8.3
从http://www.haskell.org/ghc/download_ghc_7_8_3#x86_64linux下载了最新版本并将其安装到/usr/local
.
然后我更新了我cabal
的版本1.20.0.3
.
我输入cabal install QuickCheck
了我的终端,得到了:
Resolving dependencies...
Configuring tf-random-0.5...
Building tf-random-0.5...
Preprocessing library tf-random-0.5...
[1 of 4] Compiling System.Random.TF.Gen ( src/System/Random/TF/Gen.hs, dist/build/System/Random/TF/Gen.o )
[2 of 4] Compiling System.Random.TF.Init ( src/System/Random/TF/Init.hs, dist/build/System/Random/TF/Init.o )
src/System/Random/TF/Init.hs:94:5: Warning:
In the use of ‘bitSize’ (imported from Data.Bits):
Deprecated: "Use 'bitSizeMaybe' or 'finiteBitSize' instead"
[3 of 4] Compiling System.Random.TF.Instances ( src/System/Random/TF/Instances.hs, dist/build/System/Random/TF/Instances.o )
[4 of 4] Compiling System.Random.TF ( src/System/Random/TF.hs, dist/build/System/Random/TF.o )
/usr/bin/ld: …
Run Code Online (Sandbox Code Playgroud) 我为C/C++ Linux Developers安装了Eclipse IDE来编写一些cpp代码.据我所知,无论我使用哪个版本的Eclipse,它总是可以用来编写一些java源代码.
我这样做了:
我该怎么办?
如何运行我的java应用程序?