Help ! C++ Compiler Not WOrking

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Help ! C++ Compiler Not WOrking

 
0
  #1
Dec 11th, 2008
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 .
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Help ! C++ Compiler Not WOrking

 
0
  #2
Dec 11th, 2008
Have you inluded iostream.h ?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #3
Dec 11th, 2008
Yes Sir I did.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #4
Dec 11th, 2008
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[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;
}
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #5
Dec 11th, 2008
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)
Last edited by ninja_gs; Dec 11th, 2008 at 6:18 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Help ! C++ Compiler Not WOrking

 
0
  #6
Dec 11th, 2008
Sir I do not see the iostream.h in the code shown above.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #7
Dec 11th, 2008
oh sorry . now when i include it :
error :
1 e:\psgitd~1\finals~1\greatest.cpp
iostream.h: No such file or directory
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #8
Dec 11th, 2008
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
Last edited by ninja_gs; Dec 11th, 2008 at 6:44 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Help ! C++ Compiler Not WOrking

 
0
  #9
Dec 11th, 2008
Post all your new code please
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 44
Reputation: ninja_gs is an unknown quantity at this point 
Solved Threads: 0
ninja_gs's Avatar
ninja_gs ninja_gs is offline Offline
Light Poster

Re: Help ! C++ Compiler Not WOrking

 
0
  #10
Dec 11th, 2008
Okay ,
  1. #include<iostream.h>
  2. #include<stdio.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6. int a[3];
  7. int s=3;
  8. int i,j,temp;
  9. for(i=0;i<s;i++)
  10. cout<<a[i]<<" ";
  11. cout<<endl;
  12. for(i=0;i<s;i++)
  13. /*
  14. int idx;
  15. char str[STRINGLENGTH];
  16. int numbersfound = 0;
  17. int dotsfound = 0;
  18. for (idx=0; (idx<STRINGLENGTH) && (str[idx]); idx++){
  19.   numbersfound += ((str[idx] >= '0') && (str[idx] <= '9'));
  20.   dotsfound += (str[idx] == '.');
  21. }
  22. if (numbersfound == STRINGLENGTH)
  23.   printf("integer");
  24. else if ((dotsfound == 1) && (numbersfound == STRINGLENGTH-1))
  25.   printf("floating point");
  26. else
  27.   printf("string");
  28.  
  29. */
  30. for(j=0;j<(s-i);j++)
  31. if(a[j]>a[j+1])
  32. {
  33. temp=a[j];
  34. a[j]=a[j+1];
  35. a[j+1]=temp;
  36. }
  37.  
  38. for(i=0;i<s;i++)
  39. cout<<a[i]<<" ";
  40. cout<<endl;
  41. getchar();
  42. return 1;
  43. }
Last edited by Ancient Dragon; Dec 11th, 2008 at 7:48 pm. Reason: add code tags
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC