I've looked at a lot of solutions for this problem but none have worked
Main:
#include "player.cpp"
#include "player.h"
#include <iostream>
#include <SDL.h>
using namespace std;
int main() {
player p;
SDL_Init(SDL_INIT_EVERYTHING);
for (;;) {
p.move()
}
}
player.h:
#pragma once
#ifndef PLAYER_H
#define PLAYER_H
class player {
private:
short x = 0;
short y = 0;
public:
void move() {
std::cout << x << '\n';
x += 1;
}
};
#endif
player.cpp:
#include "player.h"
#include <iostream>
It keeps saying cout is not a member of std, what am I doing wrong?