First Upload

This commit is contained in:
2022-02-25 15:33:16 +02:00
commit 0c74d10f0d
295 changed files with 74784 additions and 0 deletions

39
22- recorstion2/ex2.c Normal file
View File

@@ -0,0 +1,39 @@
#include "General.h"
//---------------------------------------------------------------------------------------
// Akeltoni
// --------
//
// General : Gets a string and arranges it "Akeltoni".
//
// Parameters :
// str_start - a pointer of string (char *)
//
// Return value : None.
//
//---------------------------------------------------------------------------------------
// Programmer : Cohen Idan
// Student No : 211675038
// Date : 30.12.2019
//---------------------------------------------------------------------------------------
void Akeltoni(char * str_start)
{
unsigned int str_len;
string new_string;
if (*str_start)
{
CopyString(new_string, ++str_start);
str_len = StringLength(new_string);
*str_start = *(new_string + str_len - ONE);
*(new_string + str_len - ONE) = BACKSLASH_ZERO;
CopyString(++str_start, new_string);
Akeltoni(str_start);
}
}
void main(void)
{
string test = "ABCDEFGH";
Akeltoni(test);
printf("%s\n", test);
}