image.png

选择C Executable

输入路径
Language standard :C99
image.png

main.c

  1. #include <stdio.h>
  2. void main(){
  3. char *string="I love China!";
  4. printf("%s\n",string);//I love China!
  5. }

CMakeLists.txt

# cmake_minimum_required(VERSION <specify CMake version here>)
project(helloworld C)

set(CMAKE_C_STANDARD 99)

add_executable(helloworld main.c)