Close
To suscribe Cquery.h please enter your email below..
After suscribing kindly check your mail box immediately
to complete your suscription.
I don't want any update | Let me download
Cquery.h
Code less C fast..
Download v0.1
Cquery.h is written by a student of SSUET by keeping TURBOC compiler in his mind only.
All the code are copyrighted so please respect other's efforts :) and don't distribute Cquery.h with your name.
Thanks.

Saturday, 5 April 2014

Shuffle_str(string)

str_shuffle takes string as an argument then return a shuffled string.


Syntax:


shuffle_str(string);

Examples:


#include<cquery.h>
void main(void)
{
char z[20] = "Cquery Rocks";
int i;
for(i = 0 ; i < 10 ; i++)
{
printf("%s\n",shuffle_str(z)); 
}
}

Remember shuffle_str does not shuffle original string as
#include<cquery.h>
void main(void)
{
char z[20] = "Cquery Rocks";
printf("%s\n",shuffle_str(z)); //possible output: kCoq rRuseyc
printf("%s",z); //output: Cquery Rocks (It didn't change)
}

As it return a shuffled string so you can copy shuffled string into another string as
#include<cquery.h>
void main(void)
{
char z[20] = "Cquery Rocks" , y[20];
strcpy(y,shuffle_str(z));
printf("%s\n",y); //possible output: kCoq rRuseyc
printf("%s",z); //output: Cquery Rocks (It didn't change)
}

#include<cquery.h>
void main(void)
{
char z[20] = "Cquery Rocks";
char *y;
y = shuffle_str(z);
printf("%s\n",y); //possible output: kCoq rRuseyc
printf("%s",z); //output: Cquery Rocks (It didn't change)
}

No comments:

Post a Comment