I followed your advice and used the
Code:
printf("%d/%d/%d", month, day, year);
to manually put the"/" the date out, however, when i call on the ints outside the function, its a bunch of numbers indicating I'm not doing something right. I've tried many things to get it to work, but it just doesn't. I apologize for the simple questions but this has been a rough one :/
Here's what I got:
Code:
#include <stdio.h>
#define TICKER "LRCX"
#define INVESTMENT_AMOUNT "10,000.00"
//Prototypes
int getdate(int* month1,int* day1,int* year1,int* month2,int* day2,int* year2);
float getprice(float* BPrice, float* SPrice);
//MAIN
int main()
{
printf("HELLO THERE!\n");
printf("Assignment #4\n");
printf("Code::Blocks\n");
//Local Declarations
float BPrice;
float SPrice;
int month1, day1, year1, month2, day2, year2;
//Starting Functions
getdate(&month1, &day1, &year1,&month2, &day2, &year2);
getprice(&BPrice, &SPrice);
printf("\n");
printf("Purchase Date: %d/%d/%d \n", month1, day1, year1); //<-----Doesn't work!
printf("Stock: " TICKER "\n");
return 0;
}//END OF MAIN
//BUYING - SELLING DATES
int getdate(int* month1,int* day1,int* year1,int* month2,int* day2,int* year2)
{
//Local Declarations
printf("Enter purchase date as MM/DD/YY: ");
scanf("%2d/%2d/%2d", &month1,&day1,&year1);
printf("Enter the sell date as MM/DD/YY: ");
scanf("%2d/%2d/%2d",&month2,&day2,&year2);
return;
}
//Asking for buying - selling prices
float getprice(float* BPrice, float* SPrice)
{
printf("Enter purchase price: $");
scanf("%f",&BPrice);
printf("Enter selling price: $");
scanf("%f",&SPrice);
return;
}