Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Milan ( 14 years ago )
#include "stdafx.h"
#include "stdio.h"
#include "textcode.h"

void invertchars(char *text)
{
 int n=0;
 char inverze;
 while (text[n]!='\0')
 {
  if(text[n]>='0' && text[n]<='z')
  {  
  inverze = text[n] - '0';
  text[n]= 'z' - inverze;
  }
  n++;
 }
 
}

void revertchars(char *text)     
{ 
 int n=0;
 char inverze;
 while (text[n]!='\0')
 {
  if(text[n]>='0' && text[n]<='z')
  {  
  inverze = text[n] + '0';
  text[n]= 'z' - inverze;
  }
  n++;
 }
 
} 
 


void fileread(char *filename, char *text)
{int n=0;
 FILE *soubor;

 soubor=fopen&#40;filename, "r"&#41;;
do
 {
  text[n++]=fgetc(soubor);
 }
 while(text[n-1]!=EOF);
 text[--n]='\0';

 fclose(soubor);
 

// revertchars(text);
// invertchars(text);
}



void filewrite(char *filename, char *text)
{
 int n=0;
 FILE *soubor;

 soubor=fopen&#40;filename,"w"&#41;;
do
 {
  fputc((int) text[n++],soubor);
 }
 while(text[n]!='\0');
 
 fclose(soubor);

// invertchars(text);
// revertchars(text);
}

 

Revise this Paste

Parent: 47958
Your Name: Code Language: