September 2018
Intermediate to advanced
328 pages
9h 10m
English
The third section contains functions to add, edit, and remove transactions from the transactions linked list, as follows:
struct Node *findNodeById(int id, struct Node *withinNode) { struct Node *node = withinNode; while (node != NULL) { if (node->id == id) return node; node = node->next; } return NULL;}void addTransaction(int id, int categoryId, float rawAmount, float cookedAmount) { appendNode(&transactionsHead, id, categoryId, rawAmount, cookedAmount);}void editTransaction(int id, int categoryId, float rawAmount, float cookedAmount) { struct Node *foundNode = findNodeById(id, transactionsHead); if (foundNode != NULL) { foundNode->categoryId = categoryId; foundNode->rawAmount = rawAmount; foundNode->cookedAmount ...Read now
Unlock full access