sorry for the many questions but I only post here once im stuck
i have 2 questions:
1. How do i display the values in the text file?(i know it uses loop but i have no idea how to)
2. How do i add the prices if it keeps changing?
this works..as for displaying the values i've seen several videos that uses arrays and loops but i can't seem to understand it..i just dont want to copy codes cuz its useless if i don't understand it
Actually, you can use string instead and i don't recommend using an array with constant sized elements because it is inefficient, the value you will read can either extend the size or is lower than the allocated size, which will either cause errors and memory leak.
Use string instead in place of the char array:
instead of char product_name[10];, use string product_name
With string, you don't have to know how many elements you will have to declare
during initialization on the char array
so its like when the first time it loops it stores 1.00 to a variable/memory and when it loops again it stores 0.75 to another so when its time to choose a product to buy the prices will be stored and i just have to access those variable