Re: Requesting help for programming/ CS majors?
see Rushy's post for a full explanation of how you can do these tasks manually. that's your fail-safe.
here's some info for a possible C++ specific shortcut for the alphabetizing task. I have no idea how the sort function works haha, but if you get it down, it could save you some time.
http://stackoverflow.com/questions/1...th-char-arrayc
and Superfreak, be sure to give yourself time for these assignments! having a "get it done now, learn later" mentality will hurt you in the long run
edit: actually after staring at that StackOverflow page for a bit I think I get what the parameters for the function are.
once you've got a char array, you can use that sort() function. your arguments inside those parentheses are actually pointers.
array is a pointer to the start of the array, and
array+sizeof(array) is a pointer to the first memory address after the array
I think? lol
see Rushy's post for a full explanation of how you can do these tasks manually. that's your fail-safe.
here's some info for a possible C++ specific shortcut for the alphabetizing task. I have no idea how the sort function works haha, but if you get it down, it could save you some time.
http://stackoverflow.com/questions/1...th-char-arrayc
and Superfreak, be sure to give yourself time for these assignments! having a "get it done now, learn later" mentality will hurt you in the long run

edit: actually after staring at that StackOverflow page for a bit I think I get what the parameters for the function are.
Code:
char array[] = "zabgqkzg"; std::sort(array, array+sizeof(array));
array is a pointer to the start of the array, and
array+sizeof(array) is a pointer to the first memory address after the array
I think? lol









Comment