I'm reading a book for beginners to programming. It's on Obj-C.
The part I'm reading about now is on functions and data structures.
This code is straight from the book. The author ask me to type it as I read along to better understand. It sure does help. I'm stuck on something here.
In this function one of the arguements is "theBudget". I don't see where he ever had me declare this variable and so I'm thinking it is not a variable at all. Could someone explain what this is, also explain what is going on with
I know budget is the struct type but it looks like it's multiplying it with theBudget.
Here is code...not sure how much to post to help you so will start from top all the way to my code in question. (LOL I'm typing this on my Desktop and just tried to copy and paste from my mac to desktop! Need coffee!) I have 3 monitors going right now so honest silly mistake!
Going to post this then just edit the post on my mac...one moment please.
Here we go..
The part I'm reading about now is on functions and data structures.
This code is straight from the book. The author ask me to type it as I read along to better understand. It sure does help. I'm stuck on something here.
In this function one of the arguements is "theBudget". I don't see where he ever had me declare this variable and so I'm thinking it is not a variable at all. Could someone explain what this is, also explain what is going on with
Code:
"budget* theBudget.
I know budget is the struct type but it looks like it's multiplying it with theBudget.
Here is code...not sure how much to post to help you so will start from top all the way to my code in question. (LOL I'm typing this on my Desktop and just tried to copy and paste from my mac to desktop! Need coffee!) I have 3 monitors going right now so honest silly mistake!
Here we go..
Code:
#import <Foundation/Foundation.h>
typedef struct {
float exchangeRate;
double budget;
//double euroTransaction;
double exchangeTransaction;
} budget;
//budget vacationBudget;
budget vacationBudgetEurope;
budget vacationBudgetEngland;
//void spendDollars (double dollars);
//void chargeEuros (double euros);
void spendDollars(budget* [COLOR="RoyalBlue"]theBudget[/COLOR], double dollars);
void chargeForeignCurrency(budget* theBudget, double foreignCurrency);
int main (int argc, const char * argv[])
Last edited: