Results 1 to 3 of 3

Thread: alphebetize

Hybrid View

  1. #1
    Frenzied Member
    Join Date
    Jul 99
    Posts
    1,800

    alphebetize

    why isnt' my inner loop firing?

    alph and allwords are apstrings

    Code:
    apstring swap;
    	for(int i=0; i<500; i++)
    		alph[i]=allwords[i];
    	for(int z=0; z<HowManyWords(); z++)
    	{
    		for(int b=0; b<(HowManyWords()-1); b++) //word
    		{
    			for(int a=0; a<alph[b].length(); a++) //letters
    			{
    				if(alph[b][a]<alph[b+1][a])
    				{
    					swap = alph[b+1];
    					alph[b+1] = alph[b];
    					alph[b] = swap;
    				}
    			}
    		}
    	}

  2. #2
    Fanatic Member
    Join Date
    May 01
    Posts
    837
    why are you copying each character? apstring as an = operator doesn't it?
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 01
    Location
    In a microchip!
    Posts
    11,594
    Which inner loop? And do you have to use apstrings?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •