C 代码错误 : expected ';' , 标识符或 '(' 之前的 'char' 。我似乎找不到这个错误的解决方案。有人可以帮我吗?

标签 c

void record_sale()
{
    struct record_sale
    {
        char customername[25];
        char item[20];
        double price;
        double payment;

    }

    /*Declaring variables*/
    char customername[25];
    char item[20];
    double payment,price,Sales;
    int userChoice = 0;
    char sales[15];

最佳答案

在结构体 record_sale 的定义之后需要一个 ;

struct record_sale
{
    char customername[25];
    char item[20];
    double price;
    double payment;
}; //here

关于C 代码错误 : expected ';' , 标识符或 '(' 之前的 'char' 。我似乎找不到这个错误的解决方案。有人可以帮我吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29837075/

相关文章:

c - 使用 mdbg 调试带有 Windows SDK 7.1 的简​​单 C 代码

c - 确定采样音频的时间戳

c - 父子进程随机结束(linux,c,fork())

php - 我可以安排来自 Apache 的 HTTP 请求吗?

c - 如何使用 C 从 bzip2 存档中提取所有数据?

c - C 中的数据结构指针处理

python - 为什么 C 程序需要反编译器而 python 程序不需要?

objective-c - 内存管理 : NSString's stringWithCString:encoding:

c - 为什么 (1.1-1.0)*10 不是 1.0?

轮询 : How to detect if client hangs up 的 C 套接字编程