ฉันยังใหม่กับ C และต้องการความช่วยเหลือ รหัสของฉันมีดังต่อไปนี้
#include<stdio.h>
#include<conio.h>
void main()
{
int suite=2;
switch(suite)
{
case 1||2:
printf("hi");
case 3:
printf("byee");
default:
printf("hello");
}
printf("I thought somebody");
getche();
}
ฉันทำงานใน Turbo C และผลลัพธ์คือ helloI thought somebody
ไม่มีข้อความแสดงข้อผิดพลาด
กรุณาแจ้งให้เราทราบวิธีการทำงานนี้
case 1||2:
ทำตัวเหมือนcase 3:
หรือเหมือนcase 1: case 2:
หรืออะไรนะ?) - person David Schwartz   schedule 05.11.2012int main(void)
และหยุดใช้void main()
และที่สำคัญกว่านั้นคือหยุดใช้ TurboC - person Aniket Inge   schedule 05.11.2012