Re: OT: Stupid c++
// my.h header file, using a vector
#ifndef MY_H
#define MY_H
#include <vector>
using namespace std;
class test{
public:
test(){};
int insert(int in){ number_list.push_back(in); return number_list.size();};
private:
vector<int> number_list;
};
#endif
//eof
// main.cpp
#include <iostream>
#include "my.h"
int main(){
test t;
int result = t.insert(42);
cout << result << endl;
system("pause");
}
// eof
===========
Missing some white space and sequencing in the grave marker:
Strength: Dexterity: 94122 Constitution: 83 Damage: 6Defence: 94.2308 HP: -1/8 XP: 0/0
Looks like stream flushing between numbers and strings.
|