Switch language
zh
Switch theme
Light

c语言中的-sleep()-函数在-windows-和-linux-下的不同表示

在 windows 中, Sleep()

// test.c
#include <stdio.h>
#include <windows.h>
int main(){
  Sleep(3000);
  printf('hello C');
  return 0;
}

在 linux 中, sleep()

// test.c
#include <stdio.h>
#include <stdlib.h>
int main(){
  sleep(3000);
  printf('hello C');
  return 0;
}
🍀