LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2003, 12:20 AM   #1
nub47
LQ Newbie
 
Registered: Aug 2003
Posts: 18

Rep: Reputation: 0
Help debuggin telnet util.!!!


does anyone know what' s wrong
here are the errors:
Quote:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Code\sh.cpp" -o "C:\Code\sh.exe" -pg -g3 -I"C:\DEV-CPP\include\c++" -I"C:\DEV-CPP\include\c++\mingw32" -I"C:\DEV-CPP\include\c++\backward" -I"C:\DEV-CPP\include" -L"C:\DEV-CPP\lib"
C:/Code/sh.cpp:42:20: warning: unknown escape sequence '\8'
C:/Code/sh.cpp:43:20: warning: unknown escape sequence '\9'
C:/Code/sh.cpp:87:34: warning: multi-line string literals are deprecated
C:/Code/sh.cpp: In function `void call(char)':
C:/Code/sh.cpp:87: parse error before `dlss'

C:/Code/sh.cpp:95:30: warning: multi-character character constant
C:/Code/sh.cpp:95: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:98:30: warning: multi-character character constant
C:/Code/sh.cpp:98: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:98: duplicate case value
C:/Code/sh.cpp:68: previously used here
C:/Code/sh.cpp:101:30: warning: multi-character character constant
C:/Code/sh.cpp:101: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:101: duplicate case value
C:/Code/sh.cpp:71: previously used here
C:/Code/sh.cpp:103:30: warning: multi-character character constant
C:/Code/sh.cpp:103: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:103: duplicate case value
C:/Code/sh.cpp:74: previously used here

C:/Code/sh.cpp:106:30: warning: multi-character character constant
C:/Code/sh.cpp:106: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:106: duplicate case value
C:/Code/sh.cpp:77: previously used here
C:/Code/sh.cpp:109:30: warning: multi-character character constant
C:/Code/sh.cpp:109: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:109: duplicate case value
C:/Code/sh.cpp:80: previously used here
C:/Code/sh.cpp:112:30: warning: multi-character character constant

C:/Code/sh.cpp:112: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:112: duplicate case value
C:/Code/sh.cpp:83: previously used here
C:/Code/sh.cpp:115:30: warning: multi-character character constant
C:/Code/sh.cpp:115: warning: overflow in implicit constant conversion
C:/Code/sh.cpp:115: duplicate case value
C:/Code/sh.cpp:86: previously used here

Execution terminated
here is the code:
Code:
/*
    Filename: tw.cpp
    Progname: Telnet Wargames
    By: Brian Gonzalez
    Date: December 16, 2003
    Purpose: Links to good telnet wargames
         and telnet shell accounts
         that might be of interest to
         the novice and expert computer
         buff alike.
*/
#include <iostream> // for i/o: cout, cin, endl,cin.get(), etc.
#include <cstdlib>  // system() function for telnet site calls

using std::cin;     // using cin for input
using std::cout;    // using cout for output
using std::endl;    // using endl to endlines of output


void call(char option);  // calls() function prototype

int main(int argc, char** argv)
{
    char option;

	cout<< "Links to good telnet wargames\n"
        << "and telnet shell accounts\n"
        << "that might be of interest to\n"
        << "the novice and expert computer\n"
        << "buff alike\n" << endl;

    cout<< endl << endl << endl     // visual interface
        << "\t  - Telnet - Servers -\n" 
		<< "\t-------------------------\n" 
		<< "\t1.  sdf.lonestar.org\n"
		<< "\t2.  cyberspace.org\n"
		<< "\t3.  m-net.arbornet.org\n"
		<< "t\4.  nyx.net\n"
		<< "t\5.  vmsbox.cjb.net\n"
		<< "t\6.  h1me.yi.org\n"
		<< "t\7.  publiclinux.net\n"
		<< "t\8.  dlss.dhs.org\n"
		<< "t\9.  shellyeah.org\n"
		<< "t\10. ductape.net\n"
		<< "t\11. rootshell.be\n"
		<< "t\12. hannover-internet.de\n"
		<< "t\13. xbolt.net\n"
		<< "t\14. nether.net\n"
		<< "t\15. hobbiton.org\n"
		<< "t\16. freeport.xenos.net\n"
		<< "t\17. unix-shells.com\n"
		<< "\tQ...Quit" << endl;

    do
    {
        cout<< "\a\n\tEnter choice_ ";  // option input and decision call() function
        cin>> option;
        call(option);
    }
    while (option != 0); 
    
	return 0;
}

void call(char option)   // decision switch/case function (system calls for telnet)
{
    switch (option) {
            case '1' :
              system("telnet sdf.lonestar.org");
              break;
			case '2' : 
			  system("telnet cyberspace.org");
			  break;
			case '3' : 
			  system("telnet m-net.arbornet.org");
			  break;
			case '4' : 
			  system("telnet nyx.net");
			  break;
			case '5' : 
			  system("telnet vmsbox.cjb.net");
			  break;
			case '6' : 
			  system("telnet h1me.yi.org");
		      break;
			case '7' : 
			  system("telnet publiclinux.net");
			  break;
			case '8' : 
			  system("telnet dlss.dhs.org");
			  break;
			case '9' : 
			  system("telnet shellyeah.org");
			  break;
			case '10' : 
			  system("telnet ductape.net");
			  break;
			case '11' : 
			  system("telnet rootshell.be");
			  break;
			case '12' : 
			  system("telnet hannover-internet.de");
			case '13' : 
			  system("telnet xbolt.net");
			  break;
			case '14' : 
			  system("telnet nether.net");
			  break;
			case '15' : 
			  system("telnet hobbiton.org");
			  break;
			case '16' :
			  system("freeport.xenos.net");
			  break;
			case '17' :
			  system("unix-shells.com");
			  break;
			case 'q' :
            case 'Q' :
              exit(0); 
            default: 
              cout<< '\t' << "ERROR_CODE 187_1337, Invalid Input" << '\a' << endl;
    }
}
 
Old 12-19-2003, 01:17 AM   #2
shishir
Member
 
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
well these are there because of pretty erroneous coding...

first try using char and try removing the cases from inside the single quotes...
you are not taking in the characters..
and you are receiving duplicate cases as you are testing for :
case '12'
case '17' etc..
replace with case 12, and so on
let the case for case 'q' be as it is
no can do..


also fix the menu code ....these are indeed unknown escape sequences for the
compiler...
t\4. nyx.net should be \t4. nyx.net




be careful when you code....also try reading the compiler errors...you'd learn a lot more when you debug your problems on your own

Last edited by shishir; 12-19-2003 at 04:42 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup util jcombs_31 Slackware 2 01-13-2005 11:50 AM
debuggin software drisay Slackware 1 10-13-2004 02:26 AM
Debuggin inline methods Eran Programming 1 07-04-2004 12:40 PM
modem debuggin w/KDE normanty Linux - Newbie 2 10-28-2001 08:44 PM
modem debuggin normanty Linux - Newbie 1 10-27-2001 10:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration