There are lots of mistakes in this code:
- All your variables voterid[10]; votername[30]; voteraddr[30]; phone[15]; age; status[20] are local to function
analysis
and functiondetails
. So the data you store in those variables fromanalysis
function is not getting accessed indetails
. So, make those variables global. - In
analysis
, you have putfor
statement at wrong place. Thefor
loop is not iterating. That’s why you are not able to insert data more than once. - In
details
, there is nofor
loop to get the data from array. voterid
is an array. So, put value in it using the index – like:voterid[i]
wherei
is the index.- You may use
iostream
instead ofiostream.h
in header file.
solved Can’t inside more than 1 time C++ [closed]