
03-05-2008, 16:40
|
 |
|
|
חבר מתאריך: 15.08.05
הודעות: 2,844
|
|
|
לא מצליח לקמפל תוכנה בסיסית בC
יש לי את הקוד הבא, ואני לא מצליח לקמפל אותו.
התכונה אמורה להציג רשימה של 6 דברים, והמשתש צריך לבחור אחד מהם ואז קורה הפונקציה הבעיה שאני לא מצליח לקמפל את הרשימה..
איפה אני טועה?
קוד PHP:
#include <stdio.h>
int main() { int m1; //selection of menu
printf("Please select one option, of the following:\n"); printf("1. Load file.\n"); printf("2. Delete line fron file.\n"); printf("3. Save to file.\n"); printf("4. Search .\n"); printf("5. Sort and displaye.\n"); printf("6. Quit.\n");
scanf("%d", &m1 );
while (m1!=6) { switch (m1) { case 1: //loads file printf("file loaded\n"); break;
case 2: //deletes from file printf("file deleted\n"); break;
case 3: //saves file printf("file saved\n"); break;
case 4: //search property
printf("file searched\n"); break;
case 5: //sort and display printf("done\n");
break;
case 6: //QUIT default: } printf("invalid selection, please try again.\n"); } return 0; }
אני מקמפל עם cc
אבל זה לא עובד .. אני מקבל שגיאות :
expected identifier, no newline at end of file
ועוד דברים שאני לא מבין..
מישהו יודע למה זה לא מקמפל?
תודה מראש
|