char *str[5]={"string","sorting","with","bubble","sort"};
char *tmp;
for(i=1;i<5;++i)
for(j=4;j>=i;--j) if (strcmp(str[j-1],str[j])>0){
tmp=str[j-1];
str[j-1]=str[j];...
Type: Posts; User: kdt
char *str[5]={"string","sorting","with","bubble","sort"};
char *tmp;
for(i=1;i<5;++i)
for(j=4;j>=i;--j) if (strcmp(str[j-1],str[j])>0){
tmp=str[j-1];
str[j-1]=str[j];...
you can use an array for the strings
and for example bubble sort to sort them
think them like an integer but use strcmp() to sort them
#include<stdio.h>
#include<string.h>
void main()
{
char *m;
char i,char1,char2;
printf("your message:");
scanf("%s",m);
for(i=0;i<(strlen(m)/2);++i){char1=m[i];
...
void main(void)
{
}
puto amo, why do you think so?
yes,i know there is no faster way
and it's the basic way
but we have a 'list' parameter and we don't know what is shown by it.
I'm sorry
I forgot to say ftime() function(in <sys\timeb.h>) is not a function of ANSI C.
for dos and unix
I hope that's what you needed
struct node *append(struct node *list, int data)
{
struct node *new;
new =(struct node*) malloc(sizeof(struct node));
if(new == NULL)
...
you can use time() function to learn the calculation time
------------------------
#include <time.h>
#include <stdio.h>
void main()
{long first_time,second_time;
time(&first_time);
// your...