No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
[code] std::string s("I'm a fairy! abc xyz ABC XYZ"); for(int i = 0; i < s.length(); i++){ s[i] >>= 1; s[i] <<= 1; [/code] Is this what your looking for ? edit: i don't think so. Sorry. :)
[code] int grade_average(int a,int b,int c) { int final_grade; final_grade=a+b+c/3; return final_grade; }[/code] The above function isn't working correctly. ( grade_average(5,5,5) == 11 in your version) [code] int grade_average(int a,int b,int c) { return (a+b+c)/3; }[/code]
For permutations you could take a look at next_permutation: [url]http://www.cplusplus.com/reference/algorithm/next_permutation.html[/url] ( and you shouldn't use void main, use int main and return an int )
[code=C++] template<class T> int indexoflargest(const vector<T> v, int startIndex, int vsize); [/code] Wouldn't it be better/faster to pass the vector by reference ?
The End.
pr2008