Dear my friend.
I want to make a linux server administrating tool ( I
am also a beginner in GNU C++).
if I open the file (smb.conf) with ifstream and try to
display its content with cout, but it does not display
its content only somewhat looksline only an address of
the variable in the memory.
like this:
"
psubroto@vh64:~/arsip/proyek/g++/BLiSS> ./liss
Choose the server you would like to administrate :
1. Samba Server
1
Samba Server Administrating Menu
--------------------------------
Workgroup name :bitp
nama workgroup-nya : bitp
0xbfffef64
psubroto@vh64:~/arsip/proyek/g++/BLiSS>
"
what is my mistake?
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;
}
}
psubroto@vh64:~/arsip/proyek/g++/BLiSS>
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250