Dev-C++에서 다음 코드를 컴파일하면 C를 익히기 시작합니다.
프로그램이 올바르게 실행됩니다.
Xcode 3.2.6에서 컴파일하면 스크린 샷처럼 보입니다.
Xcode에서 다른 컴파일러 설정을 시도했지만 동작은 동일합니다.
이것에 대한 아이디어가 있으십니까?다른 동작 xcode 및 Dev-C++
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char artist[30];
char album[30];
int tracks;
char albumsingle;
float price;
printf("Please enter CD informations below. \n \n");
printf("enter cd artist: ");
scanf("%[^\n]", artist);
printf("enter cd title: ");
fflush(stdin);
scanf("%[^\n]", album);
printf("enter no. of tracks: ");
fflush(stdin);
scanf("%d", &tracks);
printf("enter a for album s for single: ");
fflush(stdin);
scanf("%c", &albumsingle);
printf("enter price: ");
fflush(stdin);
scanf("%f", &price);
printf("\n\n\nartist: %s\n", artist);
printf("album: %s\n", album);
printf("track no.: %d\n", tracks);
if (albumsingle == 'a'){
printf("cd type: album\n");
} else {
printf("cd type: single\n");
}
printf("price: %.2f EUR\n\n", price);
system("PAUSE");
return 0;
}
어떤 스크린 샷이 있습니까? 스크린 샷을 추가하는 대신 질문에 오류 메시지를 추가하거나 예상 출력과 실제 출력을 추가하십시오. –