Issue in adding/displaying multi-dimensional char array in C -
i having difficulty in adding , displaying values in multi-dimensional char array. accepting number of days , various expense amount user , wish add them in char array.. daywise[day_1][total_expense_on_that_day];
here code wrote, kindly tell me went wrong.
char daywise[days_count][opening_bal_bk][15]; // multidimensional array printf("\nnumber of days: %d\n", days_count); for(i = 1; <= days_count; i++) { printf("\n\t"); printf("\nopening balance day %d is: %d", i, opening_bal_bk); printf("\n\t"); printf("day %d \n\t", i); printf("---------------"); printf("\n\tfood: "); food_amount = num_valid(); while(food_amount > opening_bal_bk) { printf("food amount exceeding balance,enter again!"); printf("\n\tfood: "); food_amount = num_valid(); } opening_bal_bk -= food_amount; printf("\n\ttravel: "); travel_amount = num_valid(); while(travel_amount > opening_bal_bk) { printf("travel amount exceeding balance,enter again!"); printf("\n\ttravel: "); travel_amount = num_valid(); } opening_bal_bk -= travel_amount; daywise[i][opening_bal_bk]; //adding array here
Comments
Post a Comment