示例代码1:
# include <Windows.h>
int main(){
system("start http://""www.baidu.com");
return 0;
}
示例代码:
# include <stdio.h>
# include <string.h>
# include<Windows.h>
int main(){
char a[20] = "start http://";
char b[20] = "www.baidu.com"; //指定一个长度够就行不指定程序会死
strcat(a,b); //合并字符串
//printf("%s",a);
system(a);
return 0;
}
执行结果如下图: