473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Undeclared identifier

I keep getting "error C2065: 'p' : undeclared identifier" (it's the same for
t, d, t1, etc...), while using the following programming.

#include <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <iomanip.h>
#include <fstream.h>

int main()
{
fstream suture("SUTURE.dat", ios::in)
double temp;
double pressure;
double dwell;
suture >> batch >> temp >> pressure >> dwell;

double t;
double t1
if (temp<150, temp>170)
++t;
t1=(t*20);

double p;
double p1;
if (pressure<60, pressure>70)
++p;
p1=(p*20);

double d;
double d1;
if (dwell<2, dwell>2.5)
++d;
d1=(d*20);
}

I basically need to import the suture file and come up with rejection
percentages. As far as I can tell, I've identified everything with the
double floater. Any thoughts? TIA
Apr 4 '06 #1
4 4323

John wrote:
I keep getting "error C2065: 'p' : undeclared identifier" (it's the same for
t, d, t1, etc...), while using the following programming.

#include <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <iomanip.h>
#include <fstream.h>
why use so many headers ? I do think you may need all of them. Also
use <iostream> instead of the deprecated <iostream.h> and so on..
int main()
{
fstream suture("SUTURE.dat", ios::in)
No semicolon at the end of the statement..
double temp;
double pressure;
double dwell;
suture >> batch >> temp >> pressure >> dwell;
What is batch ??

double t;
double t1
No semicolon again..
if (temp<150, temp>170)
++t;
t1=(t*20);

double p;
double p1;
if (pressure<60, pressure>70)
++p;
p1=(p*20);

double d;
double d1;
if (dwell<2, dwell>2.5)
++d;
d1=(d*20);
}

I basically need to import the suture file and come up with rejection
percentages. As far as I can tell, I've identified everything with the
double floater. Any thoughts? TIA


Please post a correct copy of your code and let us know if you still
have the error(s).

Apr 4 '06 #2
>> if (temp<150, temp>170)
if (pressure<60, pressure>70)
if (dwell<2, dwell>2.5)


what is the comma (,) doing in the if loop?

gangs.

Apr 4 '06 #3

"John" <y_****************@hotmail.com> wrote in message
news:hx******************@bgtnsc04-news.ops.worldnet.att.net...
I keep getting "error C2065: 'p' : undeclared identifier" (it's the same
for
t, d, t1, etc...), while using the following programming.

#include <iostream.h>
#include <stdlib.h>
#include <math.h>
#include <iomanip.h>
#include <fstream.h>

int main()
{
fstream suture("SUTURE.dat", ios::in)
need ; at end of line
double temp;
double pressure;
double dwell;
suture >> batch >> temp >> pressure >> dwell;

double t;
double t1
if (temp<150, temp>170)
++t;
t was never initialized. Value here is just about anything.
t1=(t*20);
since t is just about anything, t1 is just about anything times 20.
double p;
double p1;
if (pressure<60, pressure>70)
++p;
p1=(p*20);
Same here, p never initialized.
double d;
double d1;
if (dwell<2, dwell>2.5)
++d;
d1=(d*20);
Need I say it about d?
}

I basically need to import the suture file and come up with rejection
percentages. As far as I can tell, I've identified everything with the
double floater. Any thoughts? TIA

Apr 4 '06 #4

gangs wrote:
if (temp<150, temp>170)
if (pressure<60, pressure>70)
if (dwell<2, dwell>2.5)


what is the comma (,) doing in the if loop?

gangs.


If is not a loop. Loop is something which repeats itself a specified
number of time. if is a conditional statement.

Apr 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Saurabh Aggrawal | last post by:
Hi, if (iter->m_name.compare(pstrName) == 0) { // Provide our object. *ppunkItem = iter->m_pUnknown; // Addref our object... iter->m_pUnknown->AddRef(); break; }
9
by: W. Van Hooste | last post by:
Just starting with C, can somebody explain why this does not work or point me in the right direction? I wrote some tools and did some coding but cant seem to get this one. I DID declare my FILE...
5
by: Marc Gustafson | last post by:
This function is executed when a application file is double-clicked to open in a VC++ application. Specifically, this function is enabled by RegisterShellFileTypes () in the application's...
0
by: Stephanie Doherty | last post by:
Hello World, I am trying to use a _spawnl function like this (and I have included the process.h file): _spawnl(_P_WAIT,iporgfile,iporgfile,NULL); It compiles with the following errors: ...
6
by: Peter Rothenbuecher | last post by:
Hello, when I try to compile the following code with g++ -o client client.c #include<sys/socket.h> #include<stdio.h> #include<stdlib.h> #define ADDRESS "mysocket"; #define MAXLEN 200;
10
by: teddarr | last post by:
I am trying to construct a class with several functions and identifiers. The identifier in question is static double AIR which will hold the value of the annual interest rate in the class. I have...
2
by: aarthi28 | last post by:
Hi, I have this code that I am trying to compile, but I am getting the following errors 'CoInitializeSecurity': identifier not found 'EOAC_NONE' : undeclared identifier I have pasted the...
5
by: vmagana | last post by:
First of all I would like to indicate that I am a newbie a programming. I am having a problem compiling a sample source code that I downloaded from microsoft. When I try to build the program I get...
3
by: Anna Smidt | last post by:
Thanks for the help so far. I have some problems left. One of them is an undeclared identifier, but it's unclear to me why the compiler fights with me. It says "iter: undeclared identifier" I...
1
by: LuxCkrown | last post by:
Hey everyone, i've been browsing for a fix to my problem 1>c:\documents and settings\user\desktop\judis_repack\judis repack\judis repack\maplestoryserver\inventory.cpp(386) : error C2065: 'amount'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.