Beruflich Dokumente
Kultur Dokumente
Sponsored by:
This code will make you understand simple by accepting 4 strings and
sorting it through Bubble sort i trust this u help for C and C++ Beginner.
INCLUDE files:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
//
//INCLUDE files for :A simple strings so
// rting
//**************************************
//
#include <iostream.h>
#include <string.h>
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
Terms of Agreement:
By using this code, you agree to the following terms...
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it)
freely and with no charge.
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of
copyright laws.
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
//**************************************
//
// Name: A simple strings sorting
// Description:This code will make you u
// nderstand simple by accepting 4 strings
Latest postings for C/ // and sorting it through Bubble sort i tru
C++. // st this u help for C and C++ Beginner.
// By: Tahseen
Simple Payroll
Syste Using Object
//
Oriented Programming // Inputs:Ask to enter 4 strings
By Jake Rodriguez //
Pomperada on 3/8 // Returns:returns sorting strings
//
(Screen Shot)
// Assumes:User should be aware of Array
// s, boolean,for loops.
Black Jack OOP
By Micu Danie on 3/8 //
// Side Effects:Not much its only like b
// eginiing of C and C++ Programer
Click here to put this ticker on
//
your site! //This code is copyrighted and has// limited warranties.Please see http://
// www.Planet-Source-Code.com/vb/scripts/Sh
// owCode.asp?txtCodeId=3714&lngWId=3//for details.//**************************************
Daily Code Email //
To join the
'Code of #define ELEMENT 4
the Day'
Mailing List
#define LENGTH 20
click here! void getdata(char str[ELEMENT][LENGTH]);
void show(char str[ELEMENT][LENGTH]);
void sort(char str[ELEMENT][LENGTH]);
void main()
1 of 4 3/11/2010 2:06 AM
A simple strings sorting by Tahseen http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCode...
{
char str[ELEMENT][LENGTH];
cout<<"Find the sortin of string\n";
getdata(str);
sort(str);
show(str);
}
{
int loop;
for(loop=0;loop<ELEMENT;loop++)
{
cin.getline(str[loop],LENGTH);
}
{
char temp[LENGTH];
int loop;
bool flag;
do
{
flag=false;
for(loop=0;loop<ELEMENT;loop++)
{
if(strcmp(str[loop],str[loop+1])>0)
{
flag=false;
strcpy(temp,str[loop]);
strcpy(str[loop],str[loop+1]);
strcpy(str[loop+1],temp);
flag=false;
}
}while(flag!=false);
{
int loop;
cout<<endl;
for(loop=0;loop<ELEMENT;loop++)
{
cout<<str[loop]<<endl;
}
2 of 4 3/11/2010 2:06 AM
A simple strings sorting by Tahseen http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCode...
Your Vote!
C++ Programming
The latest & greatest in parallel computing. Visit
our expert blog!
www.drdobbs.com/Go-Parallel
3 of 4 3/11/2010 2:06 AM
A simple strings sorting by Tahseen http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCode...
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account
you registered on the site, so you can correspond directly.
NOTICE: The author of this code has been kind enough to share it with you. If you have a criticism,
please state it politely or it will be deleted.
For feedback not related to this particular code, please click here.
Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the
Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro
Discussion Forum | Live Chat | Games | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | Open
Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy
Copyright© 1997-2010 by Exhedra Solutions, Inc. All Rights Reserved. By using this site you agree to its Terms and
Conditions. Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions,
Inc.
4 of 4 3/11/2010 2:06 AM