I use Turbo C++ compiler to compile Cpp program.
when i use it . shows error( undef :"cout " "endl") but included CONIO.h . Also I checked OPTIONS-> DIR - where I have TC Folder(My case I have it in E:\TC\INCLUDE & E:\TC\LIB) Even The Example Programs is Not Running . It Doesn't Recosing the Header files .

Please Help me .
Please Send Me some Guide lines .

Member Avatar for iamthwee

Have you inluded iostream.h ?

Yes Sir I did.

It was Just a Basic Program to Find Greates Three No ;
Here is :
#include<stdio.h>
#include<conio.h>
int main()
{
int a[3];
int s=3;
int i,j,temp;
for(i=0;i<s;i++)
cout<<a<<" ";
cout<<endl;
for(i=0;i<s;i++)
/*
int idx;
char str[STRINGLENGTH];
int numbersfound = 0;
int dotsfound = 0;
for (idx=0; (idx<STRINGLENGTH) && (str[idx]); idx++){
numbersfound += ((str[idx] >= '0') && (str[idx] <= '9'));
dotsfound += (str[idx] == '.');
}
if (numbersfound == STRINGLENGTH)
printf("integer");
else if ((dotsfound == 1) && (numbersfound == STRINGLENGTH-1))
printf("floating point");
else
printf("string");

*/
for(j=0;j<(s-i);j++)
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}

for(i=0;i<s;i++)
cout<<a<<" ";
cout<<endl;
getchar();
return 1;
}

Sir while I Compile it shows this error :

e:\psgitd~1\finals~1\greatest.cpp:9: `cout' undeclared (first use this function)
e:\psgitd~1\finals~1\greatest.cpp:9: (Each undeclared identifier is reported only once
e:\psgitd~1\finals~1\greatest.cpp:9: for each function it appears in.)
e:\psgitd~1\finals~1\greatest.cpp:10: `endl' undeclared (first use this function)

Member Avatar for iamthwee

Sir I do not see the iostream.h in the code shown above.

oh sorry . now when i include it :
error :
1 e:\psgitd~1\finals~1\greatest.cpp
iostream.h: No such file or directory

Member Avatar for iamthwee

Post all your new code please

K thanks 4 ur Kind Help
I was Just a beginer
And I will DO it Carefuly

Sir My Goal
is to Get 3 inputs from user
and Find the Greatest of all
and list out it
but matter of fact the Big deal is
the INPUT may be int or may be float or char
1st i need figurout the ds of input and the find greatest .

This is my point,
Any Suggestion Sir

Okay ,

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3];
int s=3;
int i,j,temp;
for(i=0;i<s;i++)
cout<<a[i]<<" ";
cout<<endl;
for(i=0;i<s;i++)
/*
int idx;
char str[STRINGLENGTH];
int numbersfound = 0;
int dotsfound = 0;
for (idx=0; (idx<STRINGLENGTH) && (str[idx]); idx++){
  numbersfound += ((str[idx] >= '0') && (str[idx] <= '9'));
  dotsfound += (str[idx] == '.');
}
if (numbersfound == STRINGLENGTH)
  printf("integer");
else if ((dotsfound == 1) && (numbersfound == STRINGLENGTH-1))
  printf("floating point");
else
  printf("string");

*/
for(j=0;j<(s-i);j++)
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}

for(i=0;i<s;i++)
cout<<a[i]<<" ";
cout<<endl;
getchar();
return 1;
}

Sir My Goal
is to Get 3 inputs from user
and Find the Greatest of all
and list out it
but matter of fact the Big deal is
the INPUT may be int or may be float or char
1st i need figurout the ds of input and the find greatest .

This is my point,
Any Suggestion Sir

Member Avatar for iamthwee

Sir I don't think you need to sort the input from lowest to biggest.

That is a clue.

okay i got it
but how to find the User Input is flaoting or char or int
how to chek ??

Member Avatar for iamthwee

The way I see it is to accept input as a char array.

And write a parser to decipher one from the other.

For example?
http://forum.codecall.net/c-c/8924-check-if-input-int-float-char.html

Unless there is an easier c++ command, I don't know, and it is hardly going to work with the antiquated version of turbo c you probably have? But then I don't know what version of turbo c you have...

Thanks ;-)

1 e:\psgitd~1\finals~1\greatest.cpp
iostream.h: No such file or directory

Because it's #include <iostream> no ".h".

Hi guys Can you explain the code
int idx;

char str[STRINGLENGTH];
int numbersfound = 0;
int dotsfound = 0;
for (idx=0; (idx<STRINGLENGTH) && (str[idx]); idx++){
  numbersfound += ((str[idx] >= '0') && (str[idx] <= '9'));
  dotsfound += (str[idx] == '.');
}
if (numbersfound == STRINGLENGTH)
  printf("integer");
else if ((dotsfound == 1) && (numbersfound == STRINGLENGTH-1))
  printf("floating point");
else 
  printf("string");

please............

The header file you want is <iostream>, not <iostream.h>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.