Hallo zusammen,
ich habe ein kleines problem bei dem ich jetzt nach 2 stunden völlig erfolgloser recherche einfach überhaupt nicht weitergekommen bin. und zwar muss ich eine Zeichenfolge die in ANSI kodiert ist in ASCII umwandeln und dann ausgeben.
bevor ich jetzt lange erkläre wie das so aussieht stelle ich mal den code online:
#include <stdio.h>
/*
INCOMPLETE function to decode the destination storage
*/
char* decode(char*,int,int,int)
{
/*EDIT: getchar ist von mir noch drinnen gestanden*/
return array;
}
int main()
{
//Declares an array with two rows each 100 characters long
char destinationStorage[2][100];
//Fills the two lines of the array with the different ANSI coded characters
//sprintf works like printf. It writes the result not on console but in a given array.
sprintf(destinationStorage[0],"Bssjwbm;!Qmbofu;Sjtb!Dppse;59023O!27033P!Ujnf!23;42!Ebuf;!15/17/3199");
sprintf(destinationStorage[1],"Eftujobujpo;!");
//Start of exercise...
return 0;
}
in der anleitung steht, dass ich vom ascii code jedes zeichens jeweils den wert 1 abziehen muss, damit die zeichenfolge anschließend richtig ausgegeben wird.
das ganze muss ich oben in der decode funktion realisieren vermute ich mal.
bin kurz vorm verzweifeln weil ich einfach null plan hab wie das jetzt funktionieren soll. der einzige hinweise, der mir dazu gegeben wurd ist, dass "ich mich jetzt ja mit pointern und arrays auskenne" ... das hilft mir aber beim besten willen nicht.
also hoffentlich kann mir jemand von euch helfen!!