小编zom*_*000的帖子

定义函数以在 C++ 中返回结构

using namespace std;
#include <iostream>
#include <cstring>

struct distance {
    int Kilometer;
    int Meter;
    int Centimeter;
};

distance add() {
}

int main() {
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

试图定义一个返回“距离”数据类型的函数。在尝试定义函数时,我遇到了“距离不明确”的问题。

c++ struct function

-1
推荐指数
1
解决办法
86
查看次数

标签 统计

c++ ×1

function ×1

struct ×1