Can ne-1 explain 2 me the output of the following code ?

(Mind well, it's completely legal C code !! ; n it actually won the International Obfuscated C Code Contest.)

#include<stdio.h>
main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

Recommended Answers

All 14 Replies

Since it's an IOCCC entry, go find the explanatory notes which come with the program.

what is the relevance of the above link ?

Nothing, he was just being his usual self... ;-)

Anyways, go to this site and read the hint files which come along with the code to get an understanding of whats going -- though if you are a beginner to intermediate programmer, it would be difficult for you make any sense.

that program is pure nonsense -- it will not compile.

Can ne-1 explain 2 me the output of the following code ?

(Mind well, it's completely legal C code !! ; n it actually won the International Obfuscated C Code Contest.)

#include<stdio.h>
main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

Code tags won't help here! I guess in some countries April first falls on a later date! This code has only one purpose, to test the mental constipation of the typical C programmer.

that program is pure nonsense -- it will not compile.

Hmm?

#gcc main.c
main.c:14:68: warning: backslash-newline at end of file
#./a.out
On the first day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eighth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eleventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

#

Hmm?

Yea, I was trying to compile it in a *.cpp file, which doesn't work. compiles ok as *.c

can anybody predict the output of this code?

# include<iostream.h>
#include<conio.h>
#include<string.h>
class tel_directory
{
char address[20];
public:
char name[20];
int phoneno;
void getdata( );
void dispdata( );
void modifydata( );
void deletedata( );
};
void tele_directory::getdata( )
{
cout<<”\nTelephone Directory Registration”;
cout<<”\nEnter Customer Name”;
cin>>name;
cout<<”\nEnter Phone Number”;
cin>>phoneno;
cout<<<<”\nEnter Address”;
cin>>address;
}
void tele_directory::modifydata( )
{
int newtele_no;
cout<<”\nEnter the new telephone number\n”;
cin>>newtele_no;
phoneno=newtele_no;
}


void tele_directory::deletedata( )
{
phoneno=0;
strcpy(name,” “);
strcpy(address,” ”);
}
void tele_directory::dispdata( )
{
cout<<”\n\t”<<phoneno<<”\t\t\t”<<name<<<<”\t\t\t”<<address;
}
void main( )
{
clrscr( );
tele_directory t[10];
int choice,i=0;
int tno;
char tname[20]
do{
cout<<”\n1:New Customer\t\n”;
cout<<”\n2:Modify\t\n”;
cout<<”\n3:delete \t\n”;
cout<<”\n4:Display\t\n”;
cout<<”\n5:Exit \t\n”;
cin>>choice;
switch(choice)
{
case1:
i=i+1;
t.getdata( );
break;
case2:
cout<<”\nEnter Phone Number to be modified\n”;
cin>>tno;
for(int j=0;j<=i;j++)
if(t[j].phoneno==tno)
t[j].modifydata( );
break;


case 3:


cout<<”\nEnter Phone Numberto be deleted\n”;
cin>>tno;
for(j=0;j<=i;j++)
if(t[j].phoneno==tno)
t[j].deletedata( );
break;
case 4:
cout<<”\n\t\t\TELEPHONE DIRECTORY\n”;
cout<”\n\t\t\t\n”;
cout<<”\n\t\t\t\t\t\t\t\tTel:03-7220201”;
cout<<”\n\n\n\TPHONE No      NAME                     ADDRESS”;
for(j=0;j<=i;j++)
t.dispdata( );
cout<<”\n\n\n\t\t\t********************”;
break;
case 5:
break;
}
}
while (choice!=5)
}

Why don't you run it and find out without needing to predict?

commented: Endorsing the use of the antiquated (Turbo c), void main() etc is strictly forbidden. -2
commented: equalizer -- your post looks ok to me :) +21
commented: I agree :) +2
Member Avatar for iamthwee

Here is the output my friend:

In file included from /usr/include/c++/4.2.1/backward/iostream.h:31,
                 from foo.cc:1:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
foo.cc:2:18: error: conio.h: No such file or directory
foo.cc:17: error: stray ‘\342’ in program
foo.cc:17: error: stray ‘\200’ in program
foo.cc:17: error: stray ‘\235’ in program
foo.cc:17: error: stray ‘\’ in program
foo.cc:17: error: stray ‘\342’ in program
foo.cc:17: error: stray ‘\200’ in program
foo.cc:17: error: stray ‘\235’ in program
foo.cc:18: error: stray ‘\342’ in program
foo.cc:18: error: stray ‘\200’ in program
foo.cc:18: error: stray ‘\235’ in program
foo.cc:18: error: stray ‘\’ in program
foo.cc:18: error: stray ‘\342’ in program
foo.cc:18: error: stray ‘\200’ in program
foo.cc:18: error: stray ‘\235’ in program
foo.cc:20: error: stray ‘\342’ in program
foo.cc:20: error: stray ‘\200’ in program
foo.cc:20: error: stray ‘\235’ in program
foo.cc:20: error: stray ‘\’ in program
foo.cc:20: error: stray ‘\342’ in program
foo.cc:20: error: stray ‘\200’ in program
foo.cc:20: error: stray ‘\235’ in program
foo.cc:22: error: stray ‘\342’ in program
foo.cc:22: error: stray ‘\200’ in program
foo.cc:22: error: stray ‘\235’ in program
foo.cc:22: error: stray ‘\’ in program
foo.cc:22: error: stray ‘\342’ in program
foo.cc:22: error: stray ‘\200’ in program
foo.cc:22: error: stray ‘\235’ in program
foo.cc:28: error: stray ‘\342’ in program
foo.cc:28: error: stray ‘\200’ in program
foo.cc:28: error: stray ‘\235’ in program
foo.cc:28: error: stray ‘\’ in program
foo.cc:28: error: stray ‘\’ in program
foo.cc:28: error: stray ‘\342’ in program
foo.cc:28: error: stray ‘\200’ in program
foo.cc:28: error: stray ‘\235’ in program
foo.cc:36: error: stray ‘\342’ in program
foo.cc:36: error: stray ‘\200’ in program
foo.cc:36: error: stray ‘\235’ in program
foo.cc:36: error: stray ‘\342’ in program
foo.cc:36: error: stray ‘\200’ in program
foo.cc:36: error: stray ‘\234’ in program
foo.cc:37: error: stray ‘\342’ in program
foo.cc:37: error: stray ‘\200’ in program
foo.cc:37: error: stray ‘\235’ in program
foo.cc:37: error: stray ‘\342’ in program
foo.cc:37: error: stray ‘\200’ in program
foo.cc:37: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\’ in program
foo.cc:41: error: stray ‘\342’ in program
foo.cc:41: error: stray ‘\200’ in program
foo.cc:41: error: stray ‘\235’ in program
foo.cc:51: error: stray ‘\342’ in program
foo.cc:51: error: stray ‘\200’ in program
foo.cc:51: error: stray ‘\235’ in program
foo.cc:51: error: stray ‘\’ in program
foo.cc:51: error: stray ‘\’ in program
foo.cc:51: error: stray ‘\’ in program
foo.cc:51: error: stray ‘\342’ in program
foo.cc:51: error: stray ‘\200’ in program
foo.cc:51: error: stray ‘\235’ in program
foo.cc:52: error: stray ‘\342’ in program
foo.cc:52: error: stray ‘\200’ in program
foo.cc:52: error: stray ‘\235’ in program
foo.cc:52: error: stray ‘\’ in program
foo.cc:52: error: stray ‘\’ in program
foo.cc:52: error: stray ‘\’ in program
foo.cc:52: error: stray ‘\342’ in program
foo.cc:52: error: stray ‘\200’ in program
foo.cc:52: error: stray ‘\235’ in program
foo.cc:53: error: stray ‘\342’ in program
foo.cc:53: error: stray ‘\200’ in program
foo.cc:53: error: stray ‘\235’ in program
foo.cc:53: error: stray ‘\’ in program
foo.cc:53: error: stray ‘\’ in program
foo.cc:53: error: stray ‘\’ in program
foo.cc:53: error: stray ‘\342’ in program
foo.cc:53: error: stray ‘\200’ in program
foo.cc:53: error: stray ‘\235’ in program
foo.cc:54: error: stray ‘\342’ in program
foo.cc:54: error: stray ‘\200’ in program
foo.cc:54: error: stray ‘\235’ in program
foo.cc:54: error: stray ‘\’ in program
foo.cc:54: error: stray ‘\’ in program
foo.cc:54: error: stray ‘\’ in program
foo.cc:54: error: stray ‘\342’ in program
foo.cc:54: error: stray ‘\200’ in program
foo.cc:54: error: stray ‘\235’ in program
foo.cc:55: error: stray ‘\342’ in program
foo.cc:55: error: stray ‘\200’ in program
foo.cc:55: error: stray ‘\235’ in program
foo.cc:55: error: stray ‘\’ in program
foo.cc:55: error: stray ‘\’ in program
foo.cc:55: error: stray ‘\’ in program
foo.cc:55: error: stray ‘\342’ in program
foo.cc:55: error: stray ‘\200’ in program
foo.cc:55: error: stray ‘\235’ in program
foo.cc:64: error: stray ‘\342’ in program
foo.cc:64: error: stray ‘\200’ in program
foo.cc:64: error: stray ‘\235’ in program
foo.cc:64: error: stray ‘\’ in program
foo.cc:64: error: stray ‘\’ in program
foo.cc:64: error: stray ‘\342’ in program
foo.cc:64: error: stray ‘\200’ in program
foo.cc:64: error: stray ‘\235’ in program
foo.cc:73: error: stray ‘\342’ in program
foo.cc:73: error: stray ‘\200’ in program
foo.cc:73: error: stray ‘\235’ in program
foo.cc:73: error: stray ‘\’ in program
foo.cc:73: error: stray ‘\’ in program
foo.cc:73: error: stray ‘\342’ in program
foo.cc:73: error: stray ‘\200’ in program
foo.cc:73: error: stray ‘\235’ in program
foo.cc:80: error: stray ‘\342’ in program
foo.cc:80: error: stray ‘\200’ in program
foo.cc:80: error: stray ‘\235’ in program
foo.cc:80: error: stray ‘\’ in program
foo.cc:80: error: stray ‘\’ in program
foo.cc:80: error: stray ‘\’ in program
foo.cc:80: error: stray ‘\’ in program
foo.cc:80: error: stray ‘\’ in program
foo.cc:80: error: stray ‘\342’ in program
foo.cc:80: error: stray ‘\200’ in program
foo.cc:80: error: stray ‘\235’ in program
foo.cc:81: error: stray ‘\342’ in program
foo.cc:81: error: stray ‘\200’ in program
foo.cc:81: error: stray ‘\235’ in program
foo.cc:81: error: stray ‘\’ in program
foo.cc:81: error: stray ‘\’ in program
foo.cc:81: error: stray ‘\’ in program
foo.cc:81: error: stray ‘\’ in program
foo.cc:81: error: stray ‘\’ in program
foo.cc:81: error: stray ‘\342’ in program
foo.cc:81: error: stray ‘\200’ in program
foo.cc:81: error: stray ‘\235’ in program
foo.cc:82: error: stray ‘\342’ in program
foo.cc:82: error: stray ‘\200’ in program
foo.cc:82: error: stray ‘\235’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\’ in program
foo.cc:82: error: stray ‘\342’ in program
foo.cc:82: error: stray ‘\200’ in program
foo.cc:82: error: stray ‘\235’ in program
foo.cc:83: error: stray ‘\342’ in program
foo.cc:83: error: stray ‘\200’ in program
foo.cc:83: error: stray ‘\235’ in program
foo.cc:83: error: stray ‘\’ in program
foo.cc:83: error: stray ‘\’ in program
foo.cc:83: error: stray ‘\’ in program
foo.cc:83: error: stray ‘\’ in program
foo.cc:83: error: stray ‘\342’ in program
foo.cc:83: error: stray ‘\200’ in program
foo.cc:83: error: stray ‘\235’ in program
foo.cc:86: error: stray ‘\342’ in program
foo.cc:86: error: stray ‘\200’ in program
foo.cc:86: error: stray ‘\235’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\’ in program
foo.cc:86: error: stray ‘\342’ in program
foo.cc:86: error: stray ‘\200’ in program
foo.cc:86: error: stray ‘\235’ in program
foo.cc:93:2: warning: no newline at end of file
foo.cc:15: error: ‘tele_directory’ has not been declared
foo.cc: In function ‘void getdata()’:
foo.cc:17: error: ‘nTelephone’ was not declared in this scope
foo.cc:17: error: expected `;' before ‘Directory’
foo.cc:18: error: ‘nEnter’ was not declared in this scope
foo.cc:18: error: expected `;' before ‘Customer’
foo.cc:19: error: ‘name’ was not declared in this scope
foo.cc:20: error: expected `;' before ‘Phone’
foo.cc:21: error: ‘phoneno’ was not declared in this scope
foo.cc:22: error: expected primary-expression before ‘<<’ token
foo.cc:22: error: expected `;' before ‘Address’
foo.cc:23: error: ‘address’ was not declared in this scope
foo.cc: At global scope:
foo.cc:25: error: ‘tele_directory’ has not been declared
foo.cc: In function ‘void modifydata()’:
foo.cc:28: error: ‘nEnter’ was not declared in this scope
foo.cc:28: error: expected `;' before ‘the’
foo.cc:30: error: ‘phoneno’ was not declared in this scope
foo.cc: At global scope:
foo.cc:33: error: ‘tele_directory’ has not been declared
foo.cc: In function ‘void deletedata()’:
foo.cc:35: error: ‘phoneno’ was not declared in this scope
foo.cc:36: error: ‘name’ was not declared in this scope
foo.cc:36: error: expected primary-expression before ‘)’ token
foo.cc:37: error: ‘address’ was not declared in this scope
foo.cc:37: error: expected primary-expression before ‘)’ token
foo.cc: At global scope:
foo.cc:39: error: ‘tele_directory’ has not been declared
foo.cc: In function ‘void dispdata()’:
foo.cc:41: error: ‘n’ was not declared in this scope
foo.cc:41: error: expected `;' before ‘t’
foo.cc: At global scope:
foo.cc:43: error: ‘::main’ must return ‘int’
foo.cc: In function ‘int main()’:
foo.cc:45: error: ‘clrscr’ was not declared in this scope
foo.cc:46: error: ‘tele_directory’ was not declared in this scope
foo.cc:46: error: expected `;' before ‘t’
foo.cc:50: error: expected initializer before ‘do’
foo.cc:47: warning: unused variable ‘choice’
foo.cc:47: warning: unused variable ‘i’
foo.cc:48: warning: unused variable ‘tno’
foo.cc:93: error: expected `}' at end of input

> can anybody predict the output of this code?
I predict a slap for
- bumping a dead thread
- hijacking a dead thread
- not using code tags
- using void main

Since the program depends on user input, the output would depend on the input.
I'll type in '5' and watch the program do bugger all - how's that?
Notwithstanding the comedy of errors which iamthwee posted.

>- bumping a dead thread
Bumping is fine as long as it's on-topic. It's debatable whether this particular bump is relevant, but I left it nonetheless.

>- hijacking a dead thread
This is tied to bumping a dead thread, and I decided just to let it slide this time.

>- not using code tags
I almost added code tags, but then I noticed that the code had no formatting, so code tags would be useless. I didn't have the time or interest to format the code for the dude.

>- using void main
I'm afraid for this the sentence is death.

can anybody predict the output of this code?
# include<iostream.h>
#include<conio.h>
#include<string.h>
class tel_directory
{
char address[20];
public:
char name[20];
int phoneno;
void getdata( );
void dispdata( );
void modifydata( );
void deletedata( );
};
void tele_directory::getdata( )
{
cout<<”\nTelephone Directory Registration”;
cout<<”\nEnter Customer Name”;
cin>>name;
cout<<”\nEnter Phone Number”;
cin>>phoneno;
cout<<<<”\nEnter Address”;
cin>>address;
}
void tele_directory::modifydata( )
{
int newtele_no;
cout<<”\nEnter the new telephone number\n”;
cin>>newtele_no;
phoneno=newtele_no;
}

void tele_directory::deletedata( )
{
phoneno=0;
strcpy(name,” “);
strcpy(address,” ”);
}
void tele_directory::dispdata( )
{
cout<<”\n\t”<<phoneno<<”\t\t\t”<<name<<<<”\t\t\t”<<address;
}
void main( )
{
clrscr( );
tele_directory t[10];
int choice,i=0;
int tno;
char tname[20]
do{
cout<<”\n1:New Customer\t\n”;
cout<<”\n2:Modify\t\n”;
cout<<”\n3:delete \t\n”;
cout<<”\n4isplay\t\n”;
cout<<”\n5:Exit \t\n”;
cin>>choice;
switch(choice)
{
case1:
i=i+1;
t.getdata( );
break;
case2:
cout<<”\nEnter Phone Number to be modified\n”;
cin>>tno;
for(int j=0;j<=i;j++)
if(t[j].phoneno==tno)
t[j].modifydata( );
break;

case 3:

cout<<”\nEnter Phone Numberto be deleted\n”;
cin>>tno;
for(j=0;j<=i;j++)
if(t[j].phoneno==tno)
t[j].deletedata( );
break;
case 4:
cout<<”\n\t\t\TELEPHONE DIRECTORY\n”;
cout<”\n\t\t\t\n”;
cout<<”\n\t\t\t\t\t\t\t\tTel:03-7220201”;
cout<<”\n\n\n\TPHONE No NAME ADDRESS”;
for(j=0;j<=i;j++)
t.dispdata( );
cout<<”\n\n\n\t\t\t********************”;
break;
case 5:
break;
}
}
while (choice!=5)
}

Perhaps, you should familiarize your self with DaniWeb rules and FAQs. You've just hacked a thread with an entirely different problem. You should start a new thread instead. Also, the last post was made more than 8 months ago.

One more point, you are not likely to get help on DaniWeb unless you post your efforts along with your problems.

Following this will help you a long way. :)

Oops I fear I've repeated the advice!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.