i have created this code but now i have to create a user defined function and everything i do it comes out wrong help!!!
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include<cstring>
#include <iomanip>
using namespace std;
int main(int argc, char* argv[]){
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"};
cout<<*(article+(rand()%5));
cout<<" ";
cout<<*(noun+(rand()%5));
cout<<" ";
cout<<*(verb+(rand()%5));
cout<<" ";
cout<<*(preposition+(rand()%5));
cout<<" ";
cout<<*(article+(rand()%5));
cout<<" ";
cout<<*(noun+(rand()%5));
cout<<".\n";
return 0;
}



LinkBack URL
About LinkBacks


