I can;t read my array of strings.
I am creating a random sentance generator program.
Here is the code I have so far:
Qt Code:
  1. int main()
  2. {
  3. char *totalSentances[200];
  4. const char *verb[]={"drove","jumped","ran","walked","skipped","fucked","smoked"};
  5. const char *noun[]={"boy","girl","dog","town","car","ganja","pussy"};
  6. const char *prep[]={"to","from","over","under","before","into","by"};
  7. const char *article[]={"the","a","one","some","any"};
  8. char temp[10],sentance[100]={NULL};
  9.  
  10.  
  11. int word_gen,i=0,article_gen,sentance_gen,j=0;
  12. srand(time(0));
  13.  
  14. for(i=1;i<=200;++i)
  15. {
  16. word_gen=0+rand()%6;
  17. article_gen=0+rand()%4;
  18.  
  19. strcpy(temp,article[article_gen]);
  20. strcat(sentance,temp);
  21. strcat(sentance," ");
  22.  
  23. strcpy(temp,noun[word_gen]);
  24. strcat(sentance,temp);
  25. strcat(sentance, " ");
  26.  
  27. strcpy(temp,verb[word_gen]);
  28. strcat(sentance,temp);
  29. strcat(sentance, " ");
  30. strcpy(temp,prep[word_gen]);
  31. strcat(sentance,temp);
  32. strcat(sentance, " ");
  33. strcpy(temp,article[article_gen]);
  34. strcat(sentance, " ");
  35. strcpy(temp,noun[word_gen]);
  36. strcat(sentance,temp);
  37. totalSentances[i]=sentance;
  38. cout<<sentance<<endl;
  39. *sentance=NULL;
  40. }
To copy to clipboard, switch view to plain text mode 

this prints out fine. I get garbage of nothing when i do this:
Qt Code:
  1. fOR( j=1;j<100;++j)
  2. cout<<totalSentances[j]<<endl
To copy to clipboard, switch view to plain text mode 

or
Qt Code:
  1. fOR( j=1;j<100;++j)
  2. cout<<*totalSentances[j]<<endl
To copy to clipboard, switch view to plain text mode 

How can I print out post load ? HELP!