On Monday 31 January 2005 03:52, Prabu Subroto wrote:
Here is my code underbelow. ===== psubroto@vh64:~/arsip/proyek/g++/BLiSS> ls bsamba.h bsamba.h~ liss liss.cpp liss.cpp~ smb.conf psubroto@vh64:~/arsip/proyek/g++/BLiSS> cat bsamba.h // Time-Stamp:<> #include
#include #include class bsamba { private:
public: void menu(); char bwg[]; void mengedit(); char Puffer[]; };
void bsamba::menu(){ cout << "Samba Server Administrating Menu\n"; cout << "--------------------------------\n" << endl; cout << "Workgroup name :"; cin >> bwg;
cout << "nama workgroup-nya : " << bwg << endl; fstream sumber("smb.conf"); if (!sumber){ cout << "Failed in opening the 'smb.conf' file\n"; exit(1); } cout << sumber << endl; }
void bsamba::mengedit(){
} psubroto@vh64:~/arsip/proyek/g++/BLiSS> cat liss.cpp // Time-Stamp: <> #include
#include #include "bsamba.h" int main(int argc, char **argv){ int svr; // for (;;){ cout << "Choose the server you would like to administrate :" << endl; cout << "1. Samba Server" << endl; cin >> svr;
switch (svr){ case 1: bsamba * sm = new bsamba(); sm->menu(); break; } } First, your header files are wrong. In the latest C++, they should be: #include <iostream> #include <fstream>
Next,
cout << sumber << endl; // This will display the file stream handle.
try:
char buf[512];
sumber >> buf;
cout << buf << endl;
I also strongly suggest you get yourself a good C++ book. This forum is not
here for learning how program in C++, it is here to help programmers with
problems.
--
Jerry Feldman