What have you tried and what error(s) do you get?
For starters, you don't initialize "arr" and only assign arr[j] when mylist[j] == "Anup", so of the 50 integers in the arr integer array, only one of them would have a defined value, which can't possibly be what you want.
Try the following after the end of your loop:
That code would access the first item in the integer array named "arr", but will likely be garbage or a random value because you have not initialized the items in the array. I suspect this is not your actual code, because I don't see where you define "j", but assuming it's defined in the actual for statement, then it will be out of scope (inaccessible and invisible) outside of the for loop. Is that what you're asking?Qt Code:
int test = arr[0]; qDebug() << "test=" << test;To copy to clipboard, switch view to plain text mode
Show your actual code (using code tags) and try again to explain what it is you are trying to do, what you have tried, and what error(s) you're getting.
Bookmarks