It sounded pretty simple at first but I seem to be getting lost in how to generate random sentences where the pointers have different rows and collums. There is nothiong similar to this in my book. This s what I have so far, any "pointers" would be greatly appreciated! (bet you haven't heard that on before.
#include <stdio.h>
#include <string.h>
void sentenceGenerator( Â char article[], Â char noun[], Â char verb[],
    char preposition[], char article[],  char noun[] );
int main()
{
const char *article[5]= Â Â { "the", "a", "one", "some", "any", Â };
const char *noun[5]= Â Â Â { "boy", "girl", "dog", "town", "car", };
const char *verb[5]= Â Â Â { "drove","jumped", "ran", "walked", "skipped", };
const char *preposition[5]={ "to", "from", "over", "under", "on", Â };
int i;
 Â
for ( i = 0; i < 6; i++ );
 *( article)   = i;
 *( noun )     = i;
 *( verb )     = i;
 *( preposition ) = i;
   srand( time( 0 ) );
   void sentenceGenerator( artical, noun, verb, preposition, article, noun )
  }
}
void sentenceGenerator( Â char article[], Â char noun[], Â char verb[],
    char preposition[], char article[],  char noun[] )
{
int i;
for (i = 0; i <20; i++)
{
 printf( "%s%s%s%s%s%s.\n", *article, *noun, *verb, *preposition, *article, *noun );
}
}
This post has been edited by jsbeckton: 11 October 2005 - 04:48 PM

New Topic/Question
Reply



MultiQuote




|