In the past, i always work on the windows. but now, i want to try a ubuntu. just begin with clang.
install clang on ubuntu from software center.
the codes below is for test.
#include<stdio.h>
int main()
{
int i=0;
printf("请输入 数组的长度 值!\n");
scanf("%d",&i);
int vec[i];
for(int j=0;j<i;j++)
vec[j]=j*100;
printf("数组中的数据如下:\n");
for(int j=0;j<i;j++)
printf("%d\n",vec[j]);
return 0;
}
compile it with:
clang -std=c++11 -stdlib=libc++ test.cpp
then it succeeds.
a specified vector.