<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>Hello Help -</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>I am new to Visual C++ and have compiled a few resource
books to help in the learning process. However, this problem - as stated
by an earlier user - I have been unable to sole.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>*** Program ***</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>// Program Random Sequence Number Generator<BR>#include
<cstdlib><BR>#include <iostream><BR>#include
<ctime></FONT></DIV>
<DIV> </DIV><FONT face=Arial>
<DIV><BR>int main()<BR>{<BR> std::cout << "Random Sequence Number
Generator (RSNG). \n"; <BR> std::cout << "Written by Dan Digman on
26-July-2002 using C++. \n \n";</DIV>
<DIV> </DIV>
<DIV> std::cout << "Input number of Replications (reps) ...
";<BR> int reps;<BR> std::cin >> reps;<BR> std::cout
<< "\n";</DIV>
<DIV> </DIV>
<DIV> std::cout << "Input number of treatments per replication (rep)
... ";<BR> int treats, limit;<BR> std::cin >>
treats;<BR> limit = treats + 1;<BR> std::cout << "\n \n";</DIV>
<DIV> </DIV>
<DIV> // Allocate memory for the array<BR> int*
intArray;<BR> intArray = new treatnum[treats];<BR> <BR> // Print
out the current replication number<BR> while (int c <= reps)
{<BR> std::cout << "Replication #%d \n",c;</DIV>
<DIV> </DIV>
<DIV> // Get random numbers<BR> int d =
1;<BR> while (d <= treats) {<BR> rnumber =
random(treats) + 1;<BR> if treatnum[d] < limit
{<BR> std::cout << "%d
",rnumber;<BR> treatnum[d] =
limit;<BR> d++;<BR> }<BR> }</DIV>
<DIV> </DIV>
<DIV> // Initialize the array<BR> int i =
0;<BR> while (i < treats) { <BR> treatnum[i] =
1;<BR> i++;<BR> }<BR> std::cout <<
"\n \n";<BR> c++;<BR> }<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>// Generate a random number and return it to main<BR>int
random(num)<BR>{<BR> int num;<BR> return
static_cast<int>((num*static_cast<long>(rand()))/(RAND_MAX+1));<BR>}</DIV>
<DIV> </DIV>
<DIV><FONT size=2>*** End Of File ***</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>When Compiled, I receive the following message
...</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>--------------------Configuration: crand - Win32
Debug--------------------<BR>Compiling...<BR>crand.c<BR>c:\program
files\microsoft visual studio\vc98\include\eh.h(32) : fatal error C1189: #error
: "eh.h is only for C++!"<BR>Error executing cl.exe.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>crand.obj - 1 error(s), 0 warning(s)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>*** End of Compile ***</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I found a few responses of which I have unsuccessfully
tried.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I have also found a few responses from the comp sci dept at
Virginia Tech - none of which pertain to this particular error
message.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Then I came across a particular response on your site
:</FONT></FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>You can use the \Tp switch. It tells the compiler
that .c files are = C++.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Frankly, I would like to try this to see if it would solve
my compiling problems but I have no idea where in the program to implement this
statement or how to use it.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Thank you in advance for your help in this
matter...</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>-Dan</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial><A
href="mailto:digman.6@osu.edu">digman.6@osu.edu</A></FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV></BODY></HTML>