VS初学者请教如何调用头文件

img

img


我初学者,我在VS上调用头文件的内容失败了,我的头文件该怎么写呢,源文件也有问题,具体该怎么写呢?

哪来的Hello类型?
test函数没有参数,但你调用的时候却传递了一个0,当然不对了啊
函数改为:
char *test()
{
return "hello";
}
main函数改为:
int main()
{
puts(test());
}

head.h文件中:


#include <stdio.h>
//Hello可能是一个类
class Hello
{
public:
    void test();
protected:

private:

};
void test()
{
     //书写函数
}

test.c文件中:

//上面跟你一样
//开始调用test函数