9Mcode comment |
|
|
|
|
|
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
กระทู้ #3058 [C] (จาก IP: 223.205.64.123)
ช่วยแก้โค๊ดหน่อยค่ะ ตัน
#include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #define N5 void main() struct Product { char ID[10]; char ProductNAME[20]; int Qty; float Price; float total; }pro; FILE *Afile; { struct Product Pro; int i; clrscr(); if ((Afile=(fopen("course.dat""wb")))==NULL) { puts("Can not File!\n"); getche(); exit(0); } for (i=0; i<N;i++ ) { printf ("Product ID:"); fflush (stdin); gets(Pro.ProductID); printf ("Product NAME:"); fflush (stdin); gets(Pro.ProductNAME); printf ("Qty:"); fflush (stdin); scanf ("%d",&Pro.Qty); printf ("Price:"); fflush (stdin); scanf ("%f",&Pro.Price); Pro.total=Pro.Qty*Pro.Price; fwrite (&Pro,sizeof(struct Product),1,Afile); } fclose(Afile) }
|
จากคุณ
:
ช่วยแก้โค๊ดทีค่ะ / svx_1122@hotmail.com [2011-03-31 10:42:00]
|
|
ความคิดเห็น #28285 (จาก IP: 101.108.26.232)
ปัญหาคืออะไร error ว่าอะไร ติดตรงไหน ช่วยอธิบายนิดนึงครับ |
จากคุณ
:
maddog [2011-03-31 11:33:06]
|
|
ความคิดเห็น #28293 (จาก IP: 223.206.32.62)
มันขึ้น error26ตัวค่ะ
Compiling WW.CPP: Error WW.CPP 16: Cannot initialize a class member here Error WW.CPP 34: Undefined symbol 'hoice' in function main() Error WW.CPP 63: Too many initializers in function addProduct() Error WW.CPP 75: 'num' is not a member of 'commodity' in function addProduct() Error WW.CPP 77: 'num' is not a member of 'commodity' in function addProduct() Error WW.CPP 81: 'name' is not a member of 'commodity' in function addProduct() Error WW.CPP 83: 'ins' is not a member of 'commodity' in function addProduct() Error WW.CPP 85: 'price' is not a member of 'commodity' in function addProduct() Error WW.CPP 87: 'num' is not a member of 'commodity' in function addProduct() Error WW.CPP 87: 'name' is not a member of 'commodity' in function addProduct() Error WW.CPP 87: 'ins' is not a member of 'commodity' in function addProduct() Error WW.CPP 87: 'price' is not a member of 'commodity' in function addProduct() Error WW.CPP 103: Too many initializers in function delProduct() Error WW.CPP 126: 'num' is not a member of 'commodity' in function delProduct() Error WW.CPP 126: 'name' is not a member of 'commodity' in function delProduct() Error WW.CPP 126: 'ins' is not a member of 'commodity' in function delProduct() Error WW.CPP 126: 'price' is not a member of 'commodity' in function delProduct() Error WW.CPP 128: 'num' is not a member of 'commodity' in function delProduct() Error WW.CPP 130: 'num' is not a member of 'commodity' in function delProduct() Error WW.CPP 130: 'name' is not a member of 'commodity' in function delProduct() Error WW.CPP 130: 'ins' is not a member of 'commodity' in function delProduct() Error WW.CPP 130: 'price' is not a member of 'commodity' in function delProduct() Error WW.CPP 153: Too many initializers in function changeProduct() Error WW.CPP 172: 'name' is not a member of 'commodity' in function changeProduct() Error WW.CPP 174: 'ins' is not a member of 'commodity' in function changeProduct() Error WW.CPP 174: Too many error or warning messages in function changeProduct() |
จากคุณ
:
ช่วยแก้โค๊ดทีค่ะ / svx_1122@hotmail.com [2011-04-10 21:45:07]
|
|
ความคิดเห็น #28297 (จาก IP: 115.67.251.66)
#include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #define N 5
void main(){
struct Product { char ProductID[10]; char ProductNAME[20]; int Qty; float Price; float total; }pro; struct Product Pro;
FILE *Afile;
int i; clrscr(); if ((Afile=(fopen("course.dat","wb")))==NULL) { puts("Can not File!\n"); getche(); exit(0); } for (i=0; i<N;i++ ) { printf ("Product ID:"); fflush (stdin); gets(Pro.ProductID); printf ("Product NAME:"); fflush (stdin); gets(Pro.ProductNAME); printf ("Qty:"); fflush (stdin); scanf ("%d",&Pro.Qty); printf ("Price:"); fflush (stdin); scanf ("%f",&Pro.Price); Pro.total=Pro.Qty*Pro.Price; fwrite (&Pro,sizeof(struct Product),1,Afile); } fclose(Afile); } |
จากคุณ
:
maddog [2011-04-12 00:45:37]
|
|
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
|
|
|
|