Click here to Skip to main content
15,889,594 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
C
while(i<k+1)
{
    generate_random_string(str,rand()%n);
    for(j=0;j<n;j++)
    {
        printf("%c",str[j]);
    }
    printf("\n");
    i++;
}


This code produces the substring of the same string what do you think about that?
Posted
Updated 16-Jan-11 10:14am
v2
Comments
Espen Harlinn 16-Jan-11 16:04pm    
If this is a question, I missed the point totally. Please elaborate!
Manfred Rudolf Bihy 16-Jan-11 16:16pm    
Edit: Spelling and grammar, added code tags.
What exactly does generate_random_string do, and why on god's earth are you taking the modulus of rand().
fjdiewornncalwe 16-Jan-11 16:38pm    
@Manfred... I suppose that is what you think of that... :)
#realJSOP 16-Jan-11 16:45pm    
Is there a point to this - at all?

1 solution

"what do you think about that?"

I think it is damn rude to delete your question when you get a reply to it.
Please do not do it again: the question and reply may help others in the same situation.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 16-Jan-11 16:30pm    
I was just going through my comments of today and came to the same conclusion.
The answer given was helpfull indeed. All OP had to do was follow the 6 steps outlined and would have arrived at a solution.
OriginalGriff 16-Jan-11 16:31pm    
Manfred: At least that answers your questions to him! :laugh:
Sergey Alexandrovich Kryukov 16-Jan-11 16:42pm    
I agree.
Manfred Rudolf Bihy 16-Jan-11 16:57pm    
Seems OP isn't going to get the homework done 'til tomorrow and his chances of finding help here are growing dimmer and dimmer. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900