Source Code for String Reversing
| Computer Science Contents............... | Data Structures | Electronics...... | Networks.... | MICRO Processors | Operating Systems |
|---|
| Data Strucutres | Linked Lists | Binary Trees | Expression Converstion's | Infix To Postfix | Infix To Prefix | Postfix To Prefix | Postfix To Infix | Postfix Expression Evaluation |
|---|
| Home............ | Linked List | Binary Trees | Arrays | Stacks | Queues | Graphs | Searching Methods | Sorting Methods |
|---|
#include <stdio.h>
#include <string.h>
char* rev(char* str)
{
int end= strlen(str)-1;
int start = 0; while( start<end )
{
str[start] ^= str[end];
str[end] ^= str[start];
str[start]^= str[end];
++start; --end; } return str;
}
int main()
{
char str[50]="Reversing a string using XOR";
puts(rev(str));
}