HELP in Gets () function

0 gayatri rout · June 16, 2014
Hello,
In turbo c++ I have made a program that calculates the number of words,lines,vowels and special characters in a paragraph.
But while compiling the error I get is "Gets()function should have a prototype."



#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
void main()
{
int p;
int h=0;
int v;
int d;
int l=1;
int s;
int w;
char *c;
p=h;
w=l=d=v=s=0;
clrscr();
cout<<"ENTER TEXT:
(TO END TYPING GIVE A TILDE[~])
";
gets(*c);

{
if(p==h)
{
p=l;
++w;
}
else if(isdigit(*c))
{
++d;
}
else if(isalpha(*c))
{
switch(s)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
++v;
break;
}
}

else if(!isalpha(*c))
{
++s;
}
else if(*c=='
')
{
++l;
}
s++;
}
cout<<"
";
cout<<"no.of words:\t"<<w<<"
";
cout<<"no.of lines:\t"<<l<<"
";
cout<<"no.of numerics:\t"<<d<<"
";
cout<<"no.of vowels:\t"<<v<<"
";
cout<<"no.of special characters:\t"<<s<<"
";
getch();
}







Post a Reply

Replies

Oldest  Newest  Rating
+1 gayatri rout · June 17, 2014
Hi,
thanks again but can I use Borland++?
because I have been coding very recently and I have the least idea about clang ++ ,g++ and IDE
0 gayatri rout · June 17, 2014
Well,
I am just a 7th grader in sai international school
so please ignore my remark!
0 gayatri rout · June 18, 2014
Excuse me ,you just can't be commenting on others country's education.Well a simple solution to my problem CAN'T I USE BORLAND C++? would do.
0 gayatri rout · June 18, 2014
I AM NOT AFTER ANY RACE !

AND SHAME SHAME ARGUING WITH A 7th GRADER.
-1 gayatri rout · June 17, 2014
Hi,thanks for the suggestions but I am new to coding so which compiler shall I be using to enhance my coding.
  • 1

C++

107,224 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator