I'm using code block in linux. When I try to build my cpp file where class Position is define, it gives an error-
in function '_start':
undefined reference to 'main'
Even after object file has been created.
All this files are in the same folder
This is the cpp file where Position is define
#include "POSITION.h"
std::string Position::pos(int num) {
switch(num) {
case 0: return "\0";
break;
case 1: return "st";
break;
case 2: return "nd";
break;
case 3: return "rd";
break;
default: return "th";
break;
}
}
This is the header file
#pragma once
#include <iostream>
class Position
{
public:
std::string pos(int num);
};