Click here to Skip to main content
15,885,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Steps to make a clickable area drawn by a user at run time Pin
Maximilien16-Feb-05 0:34
Maximilien16-Feb-05 0:34 
GeneralHelp Needed ASAP PLZ on downloading url content to file. Pin
A.Sal15-Feb-05 13:24
A.Sal15-Feb-05 13:24 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
vinnzy15-Feb-05 13:43
vinnzy15-Feb-05 13:43 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
Ravi Bhavnani15-Feb-05 15:13
professionalRavi Bhavnani15-Feb-05 15:13 
GeneralRe: Help Needed ASAP PLZ on downloading url content to file. Pin
A.Sal16-Feb-05 0:17
A.Sal16-Feb-05 0:17 
Generalhelp with the operator overloading Pin
Flydian15-Feb-05 13:16
Flydian15-Feb-05 13:16 
GeneralRe: help with the operator overloading Pin
Bob Ciora16-Feb-05 1:34
Bob Ciora16-Feb-05 1:34 
Generalproblem returning arrays Pin
aaadetos15-Feb-05 13:05
aaadetos15-Feb-05 13:05 
I have the following code, which runs w/out erroe, but fails to return the proper values...
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <fstream><br />
#include <iomanip><br />
#include <iostream><br />
using namespace std;<br />
<br />
const double PI = 3.141592653589793238462643383279502884197;<br />
double q = 1000;//STB/D<br />
double pi = 5000;//psia<br />
double rw = 0.25;//ft<br />
double h = 100;//ft<br />
double por = 0.2;<br />
double k = 200;//md<br />
double ct = 0.00003;//psi-1<br />
double Bo = 1.2;//RB/STB<br />
double visc = 1.3;//cp<br />
double C = 0.5;//RB/psi<br />
double S = 10;<br />
double tp = 200;//hrs<br />
double delta_t = 200;//hrs<br />
double a0,a1,a2,a3,a4,a5,b1,b2,b3,b4,c1,c2,c3,c4;<br />
double a[50],b[50],c[50],expint;<br />
<br />
double t[50],qsf[50],alpha,x[50],EI[50],beta[50],pd[50],pwf[50];<br />
<br />
double time_hr()<br />
{<br />
    double N=49.0;<br />
    for (int i=0;i<50;i++)<br />
    {<br />
        t[i] = 0.01*exp((i/N)*log(200/0.01));<br />
    }<br />
    return t[i];<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
//    printf("Hello World!\n");<br />
    ofstream outputdeck;<br />
    outputdeck.open("output.txt", ios::out);<br />
    <br />
    outputdeck<<"Type A: With Wellbore Storage.\n";<br />
    outputdeck<<"Time"<<setw(5)<<"Pwf"<<setw(5)<<endl;<br />
    for(int i=0;i<50;i++)<br />
    {<br />
        outputdeck<<t[i]<<endl<br />
    }<br />
<br />
<br />
    return 0;<br />
}


This code returns a value of 0 for every value of i. t[i] is supposed to increase from 0.01 to 200 as i increases from 0 to 49.

Can anyone pls tell me what i'm doing wrong?
Thank you.
GeneralRe: problem returning arrays Pin
John R. Shaw15-Feb-05 13:32
John R. Shaw15-Feb-05 13:32 
GeneralRe: problem returning arrays Pin
aaadetos15-Feb-05 16:12
aaadetos15-Feb-05 16:12 
GeneralRe: problem returning arrays Pin
$8816-Feb-05 20:30
$8816-Feb-05 20:30 
GeneralRe: problem returning arrays Pin
Branislav17-Feb-05 0:19
Branislav17-Feb-05 0:19 
GeneralRe: problem returning arrays Pin
aaadetos22-Feb-05 1:27
aaadetos22-Feb-05 1:27 
GeneralRe: problem returning arrays Pin
Branislav22-Feb-05 22:56
Branislav22-Feb-05 22:56 
GeneralRe: problem returning arrays Pin
$8816-Feb-05 0:14
$8816-Feb-05 0:14 
GeneralRe: problem returning arrays Pin
Anonymous22-Feb-05 1:23
Anonymous22-Feb-05 1:23 
GeneralRe: problem returning arrays Pin
$8822-Feb-05 2:17
$8822-Feb-05 2:17 
GeneralPrecompiled Headers Pin
JWood15-Feb-05 12:38
JWood15-Feb-05 12:38 
GeneralRe: Precompiled Headers Pin
Selvam R15-Feb-05 22:27
professionalSelvam R15-Feb-05 22:27 
GeneralRe: Precompiled Headers Pin
ionzarate16-Feb-05 2:56
ionzarate16-Feb-05 2:56 
QuestionWindow's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 12:22
InflatableGarfield15-Feb-05 12:22 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
Ravi Bhavnani15-Feb-05 12:34
professionalRavi Bhavnani15-Feb-05 12:34 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
ThatsAlok15-Feb-05 18:09
ThatsAlok15-Feb-05 18:09 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 22:09
InflatableGarfield15-Feb-05 22:09 
GeneralwaveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 11:39
anaknakal15-Feb-05 11:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.