Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-25-2004, 04:40 AM   #1 (permalink)
Andi55
Registered User
 
Join Date: Oct 2004
Posts: 1
Andi55 is on a distinguished road
Question median of a sequel

HI

What i'm trying to do is to find the median of a string of letters.
But at first the letters must put in order alphabetically.
I have wrote a C++ Programm for this step but it doesent run correctly.
Have anyone an idea ?

Here the part of the Programm:

Code:
char* sortstring( char quelle[] )
{
	char* ziel = new char[ strlen(quelle)+1];
	char* hilfe = new char[ strlen(quelle)+1];
	int a = strlen(quelle);

	strcpy (hilfe,quelle);
	strcpy (ziel,quelle);

        for( int k=0 ; k<a ; k++)
	{
		for( int i=0 ; i<a ; i++)
		{
		if(quelle[k]<hilfe[i])
		    ziel[k]=quelle[k];
		else
		    ziel[k]=hilfe[i];
		}
	}
	ziel[k++] ='\0';
	return ziel;
}

Last edited by Andi55; 10-25-2004 at 05:15 AM.
Andi55 is offline   Reply With Quote
Old 10-27-2004, 07:28 AM   #2 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
I know what a median is, but I don't know what a median is in a sequal of letters. If you could explain that, than I could start coding a bit.
__________________
Valmont is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Median keystoneman Standard C, C++ 6 09-23-2004 09:12 AM
Apple sells supercomputer sequel sde Code Newbie News 0 06-22-2004 07:03 AM


All times are GMT -8. The time now is 03:18 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting