Noch mal using namespace std;



  • nun ich habe verstanden was namespace ist. Aber wiso bekomme ich fehler bei mein code?. Fehler bei MS VS 6 ist.error C2871: 'std' : does not exist or is not a namespace
    Error executing cl.exe.

    Ich muss doch std nur da verwenden wo iostream definiert wird oder? oder reichtd as wenn ich es einmal bei einer datei schreibe?

    Nun da ist die datei.
    (Die aufbabe war alle fehler suchen und finden und noch die header dateien zu verknupfen, also was für den kindergarten). Also der CODe ist nicht MEIN!.

    /*
    **********************************************************************************************************************************
    *																																 *
    *		Onoma	:	Mazarakis	Xrhstos																							 *
    *																																 *
    *		A.M.	:	018200200179																								 *
    *																																 *
    *		Skopos	:	??																											 *
    *																																 *
    *										(c) 2004 di.uoa.gr																		 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *													Entoles pros proepeksergasth												 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    //#include <iostream.h>		//I/O gia C++
    
    #include <iostream.h>		//I/O gia C++
    #include <cstdlib>			//Standard biblio8hkh gia array kirios
    #include "AdvanceString.hpp"		//Biblio8hkh(es) skopo san thn cstring.h
    #include "invertchar.hpp"			//gia invert ton char
    //dilosh namespace
    using namespace std;
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *													Entoles pros proepeksergasth												 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *														Dhlosh Sunarthseon														 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    void check_args(int, char*);
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *													Telos Dhlosh Sunarthseon													 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *													Ylopoihsh sunarthsewn														 *
    *																																 *
    **********************************************************************************************************************************
    */
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //																																//
    //	Eisodos	:	Ena akeraio																										//
    //																																//
    //	Exodos	:	Ena akeraio																										//
    //																																//
    //	Skopos	:	Kuria sunarthsh pou ektelh diafores leitourgies ka8orizei to programma kai epistrefh enan akeraio sto telos.	//
    //																																//
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    int main(int argc, char* argv[])
    {
    	//Dhlosh Metablhton
    	char *str;
    	char *pattern;
    	char *newpattern;
    	char *newstr;
    	char *aux;
    //
    	*str = NULL;
    	*pattern = NULL;
    	*newpattern = NULL;
    	*newstr = NULL;
    	*aux = NULL;
    
    				//Kurio Programma
    
    	check_args(argc, argv[0]);
    
    	str = argv[1];
    	pattern = argv[2];
    
    	int strlen = StrLen(str);
    	int patternlen = StrLen(pattern);
    
    	newstr = new char[strlen];
    
    	newpattern = new char[patternlen];
    
    	aux = new char[2];
    
    	StrCpy(newpattern, pattern);
    	StrRevers(newpattern);
    
    	while(*str) {
    		if (StrTok(pattern, str)) {
    			StrCat(newstr, newpattern);
    			str = StrRChr(pattern, str);
    		}
    		else {
    			*aux = Invert(*str);
    			aux[1] = '\0';
    			StrCat(newstr, aux);
    			str++;
    		}
    	}
    
    	cout << newstr << endl;
    
    	delete[] aux;
    
    	delete[] newpattern;
    
    	delete[] newstr;
    	while(1)
    	{}
    
    	return 0;
    }
    
    void check_args(int argc, char* argv0) {
    	if (argc != 3) {
    		cout << "SYNOPSIS" << endl;
    		cout << "	" << argv0 << " <STRING> <PATTERN>" << endl;
    		exit(0);
    	}
    }
    
    /*
    **********************************************************************************************************************************
    *																																 *
    *													Telos Ylopoihsh sunarthsewn													 *
    *																																 *
    **********************************************************************************************************************************
    */
    


  • Versuch mal statt #include <iostream.h>: #include <iostream>.
    -Gunnar


Anmelden zum Antworten