är i full gång med din "request" katt, är väl klar strax antar jag (=
sådärja, hyffsat "messy" kodning, men vafan, det är enkelt att fatta vad jag har gjort nu iaf...
drar upp kod n'shit här snart
Döpte funktionen till scout, simon cout, simon would be me (=
scout funktionen:
scout.h (header filen)
#ifndef ozoon_scout
#define ozoon_scout
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
class scout
{
public:
void c(string);
private:
string find86(string);
string find84(string);
string find94(string);
string find8f(string);
string find8e(string);
string find99(string);
string findall(string);
};
#endif
scout.cpp (cpp filen)
#include "scout.h"
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
//------------------------------------------------------------------------------
void scout::c(string text)
{
text=findall(text);
cout << text;
}
//------------------------------------------------------------------------------
string scout::find86(string text)//å
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('å');
text[get]='\x86';
}
return text;
}
//------------------------------------------------------------------------------
string scout::find84(string text)//ä
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('ä');
text[get]='\x84';
}
return text;
}
//------------------------------------------------------------------------------
string scout::find94(string text)//ö
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('ö');
text[get]='\x94';
}
return text;
}
//------------------------------------------------------------------------------
string scout::find8f(string text)//Å
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('Å');
text[get]='\x8F';
}
return text;
}
//------------------------------------------------------------------------------
string scout::find8e(string text)//Ä
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('Ä');
text[get]='\x8E';
}
return text;
}
//------------------------------------------------------------------------------
string scout::find99(string text)//Ö
{
int a;
int get;
a=text.size();
for(int i=0; i<a; i++)
{
get=text.find('Ö');
text[get]='\x99';
}
return text;
}
//------------------------------------------------------------------------------
string scout::findall(string text)//allt
{
text=find86(text);
text=find84(text);
text=find94(text);
text=find8f(text);
text=find8e(text);
text=find99(text);
return text;
}
in use!
#include <cstdlib>
#include <iostream>
#include "scout.h"
#include <string>
using namespace std;
int main()
{
scout out;
out.c("äckligt! ÄÄH!, jorå, MÅTTLIGT, överraskande? ÖVER FÖRVÄNTAN");
system("PAUSE>NUL");
return EXIT_SUCCESS;
}
Den konstiga meningen är bara för att testa att det funkar, vilket det gör:)
Valde även att döpa scout objectet till out, och gjorde så att funktionen heter c, vilket blir cout, fast lite omkastat och med en punkt. out.c("vadmanvill") så funkar det(=
eftersom jag tydligen inte får bifoga varken headerfiler, cpp filer eller rar filer så får ni väl vänta några min på att jag laddar upp skiten...
fixat nu:
LÄNK http://gutfucker.diinoweb.com/files/c++/scout.rar