Creating classes

Started by
4 comments, last by chosenkill6 12 years, 8 months ago
Is there any way that i can create a class in a seperate file because creating it all in one file gets really confusing. Also can i do this with functions as well? If so how?
Advertisement
For what programming language?

For what programming language?
C++
I'm using code:blocks
Anyone....Some help please...
Organizing code files in C and C++. Also:


// File:"foobar.h"
#pragma once

// foobar dependencies
#include <string>
class foobaz; // forward declaration

class foobar {
public:
void frobnicate( foobaz& f ); // prototype

private:
int a_;
std::string name_;
static int id_;
};


// File:"foobar.cpp"
#include "foobar.h"
#include "foobaz.h"

int foobar::id_ = 0; // symbol definition

void foobar::frobnicate( foobaz& f ) { // definition
f.impl( a_, name_ );
}
thank you! thats exactly what i was looking for

This topic is closed to new replies.

Advertisement