Are all the fields the same type?
What are you trying to do?
Are all the fields the same type?
What are you trying to do?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
im sorting an array of structures. there are 5 fields - one long and 4 ints. The structures will be ordered in the array by one of the 4 int fields in them, and the user selects which one to sort by. Basically, I want to be able to pass this
fieldvariable = "field1";
....
then refer later in code to the field denoted by the variable
e.g.
if fieldvariable is as above, I could have
would be seen by the program asCode:structure.fieldvariableCode:structure.field1