Click here to Skip to main content
16,005,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRegular Expression Library for C++ Pin
User 665825-Apr-03 8:23
User 665825-Apr-03 8:23 
GeneralRe: Regular Expression Library for C++ Pin
Neville Franks25-Apr-03 12:17
Neville Franks25-Apr-03 12:17 
GeneralRe: Regular Expression Library for C++ Pin
User 665826-Apr-03 5:57
User 665826-Apr-03 5:57 
GeneralRe: Regular Expression Library for C++ Pin
Vivek Rajan25-Apr-03 19:17
Vivek Rajan25-Apr-03 19:17 
GeneralRe: Regular Expression Library for C++ Pin
User 665826-Apr-03 6:03
User 665826-Apr-03 6:03 
GeneralUrgent: OnKeyDown not getting executed - In Active X Control Pin
allcodeluver25-Apr-03 8:13
allcodeluver25-Apr-03 8:13 
GeneralRe: Urgent: onkeydown not getting executed - In Active X Control Pin
allcodeluver25-Apr-03 8:29
allcodeluver25-Apr-03 8:29 
GeneralPassing Structure Variables to Function Pin
webblynx25-Apr-03 7:49
webblynx25-Apr-03 7:49 
Hello, C++ Newbie here. I have been trying to compile this program for two days and cannot seem to get it right.

I wrote a program that acts like a bank deposit. It will ask for the account number, annual rate, years of loan, and the principal balance. The program asks for all of this information, sends the variables to a function "compute", and then prints the annual interest earned back in main:

#define n 5
struct deposit {
char acnumber[10];
float* rate;
float* principal;
int* years;
float amount; };

float compute(float*,float*,int*);

void main() {
deposit d[n];
cout<<"Please enter the account information."<<endl;
for(int="" i="0;i<n;i++)" {
="" cout<<"enter="" the="" 9="" digit="" account="" number:="" ";
="" cin="">>d[i].acnumber;
cout<<"Enter number of years: ";
cin>>d[i].years;
cout<<"Enter the rate: ";
cin>>d[i].rate;
cout<<"Enter the principal amount: ";
cin>>d[i].principal;
}
compute((*d).rate,(*d).principal,(*d).years);
cout<<"The amount is: "<< d.amount <
GeneralRe: Passing Structure Variables to Function Pin
David Crow25-Apr-03 8:06
David Crow25-Apr-03 8:06 
GeneralRe: Passing Structure Variables to Function Pin
webblynx25-Apr-03 8:22
webblynx25-Apr-03 8:22 
GeneralRe: Passing Structure Variables to Function Pin
David Crow25-Apr-03 8:49
David Crow25-Apr-03 8:49 
GeneralRe: Passing Structure Variables to Function Pin
webblynx25-Apr-03 8:57
webblynx25-Apr-03 8:57 
Generalgethostbyaddr() Pin
Swinefeaster25-Apr-03 7:42
Swinefeaster25-Apr-03 7:42 
GeneralRe: gethostbyaddr() Pin
David Crow25-Apr-03 7:45
David Crow25-Apr-03 7:45 
GeneralRe: gethostbyaddr() Pin
Swinefeaster25-Apr-03 7:55
Swinefeaster25-Apr-03 7:55 
GeneralRe: gethostbyaddr() Pin
David Crow25-Apr-03 8:11
David Crow25-Apr-03 8:11 
GeneralRe: gethostbyaddr() Pin
Swinefeaster25-Apr-03 8:25
Swinefeaster25-Apr-03 8:25 
GeneralRe: gethostbyaddr() Pin
David Crow25-Apr-03 9:09
David Crow25-Apr-03 9:09 
GeneralRe: gethostbyaddr() Pin
Swinefeaster25-Apr-03 10:06
Swinefeaster25-Apr-03 10:06 
GeneralRe: gethostbyaddr() Pin
RobJones25-Apr-03 8:11
RobJones25-Apr-03 8:11 
GeneralRe: gethostbyaddr() Pin
Brian Shifrin25-Apr-03 8:23
Brian Shifrin25-Apr-03 8:23 
GeneralRe: gethostbyaddr() Pin
Swinefeaster25-Apr-03 8:27
Swinefeaster25-Apr-03 8:27 
GeneralRe: gethostbyaddr() Pin
Brian Shifrin28-Apr-03 15:44
Brian Shifrin28-Apr-03 15:44 
Generalproblem with null (uninitialized) objects Pin
Berkut25-Apr-03 7:40
Berkut25-Apr-03 7:40 
GeneralRe: problem with null (uninitialized) objects Pin
Berkut25-Apr-03 7:41
Berkut25-Apr-03 7:41 

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.