F
fastwings
mm the code
//////makemenu.h////
class menu {
public:
int op;
pmenu(int op,int sub = 0)
{
switch op
{
case 1:
show(op,0);
break;
case 2:
show(op,0);
break;
case 3:
show(op,0);
break;
case 4:
show(op,0);
break;
default:
msgerr(01);
}
}
show (int op,int sub=0)
{
cont<<"ok"<<end1<<"u press : "<<op;
}
};
/////////menus.cpp//////
#ifndef __file__
#define __file__ "telcom.db"
#endif
#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include "makemenu.h"
main {
menu p1;
char option;
int total=3,stot=9,op;
showstars(total,stot);
cont<<"Enter number 1-4"<<end1;
option = getchar();
p1.pmenu(option,0);
return(0);
}
showstars(int line,int chrs)
{
int i;
for (i=1;i<=line;i++)
{
if (i != 1)
{
cont<<end1<<setfill("*")<<setw(chrs);
}
else
{
cont<<setfill("*")<<setw(chrs);
}
}
cont<<end1;
return(1);
}
the errors:
--------------------Configuration: tt - Win32
Debug--------------------
Compiling...
menus.cpp
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(24)
: warning C4183: 'pmenu': member function definition looks like a
ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(28)
: warning C4183: 'show': member function definition looks like a ctor,
but name does not match enclosing class
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(8) :
error C2061: syntax error : identifier 'op'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(8) :
error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(9) :
error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(11)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(12)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(14)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(15)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(17)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(18)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(20)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(21)
: error C2047: illegal default
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(22)
: error C2065: 'msgerr' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2065: 'cont' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2297: '<<' : illegal, right operand has type 'char [3]'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2065: 'end1' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(8) :
error C2501: 'main' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(8) :
error C2239: unexpected token '{' following declaration of 'main'
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
error C2065: 'setfill' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
error C2065: 'setw' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(29) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(32) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
Error executing cl.exe.
menus.obj - 19 error(s), 5 warning(s)
===========================================
plz tell me how i can fix and know not to do next time i try but....
//////makemenu.h////
class menu {
public:
int op;
pmenu(int op,int sub = 0)
{
switch op
{
case 1:
show(op,0);
break;
case 2:
show(op,0);
break;
case 3:
show(op,0);
break;
case 4:
show(op,0);
break;
default:
msgerr(01);
}
}
show (int op,int sub=0)
{
cont<<"ok"<<end1<<"u press : "<<op;
}
};
/////////menus.cpp//////
#ifndef __file__
#define __file__ "telcom.db"
#endif
#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include "makemenu.h"
main {
menu p1;
char option;
int total=3,stot=9,op;
showstars(total,stot);
cont<<"Enter number 1-4"<<end1;
option = getchar();
p1.pmenu(option,0);
return(0);
}
showstars(int line,int chrs)
{
int i;
for (i=1;i<=line;i++)
{
if (i != 1)
{
cont<<end1<<setfill("*")<<setw(chrs);
}
else
{
cont<<setfill("*")<<setw(chrs);
}
}
cont<<end1;
return(1);
}
the errors:
--------------------Configuration: tt - Win32
Debug--------------------
Compiling...
menus.cpp
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(24)
: warning C4183: 'pmenu': member function definition looks like a
ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(28)
: warning C4183: 'show': member function definition looks like a ctor,
but name does not match enclosing class
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(8) :
error C2061: syntax error : identifier 'op'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(8) :
error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(9) :
error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(11)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(12)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(14)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(15)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(17)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(18)
: error C2046: illegal case
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(20)
: error C2043: illegal break
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(21)
: error C2047: illegal default
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(22)
: error C2065: 'msgerr' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2065: 'cont' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2297: '<<' : illegal, right operand has type 'char [3]'
c:\program files\microsoft visual studio\myprojects\tt\makemenu.h(27)
: error C2065: 'end1' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(8) :
error C2501: 'main' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(8) :
error C2239: unexpected token '{' following declaration of 'main'
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
error C2065: 'setfill' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
error C2065: 'setw' : undeclared identifier
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(25) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(29) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
c:\program files\microsoft visual studio\myprojects\tt\menus.cpp(32) :
warning C4552: '<<' : operator has no effect; expected operator with
side-effect
Error executing cl.exe.
menus.obj - 19 error(s), 5 warning(s)
===========================================
plz tell me how i can fix and know not to do next time i try but....