Question
Can someone tell me why this gives an error? Please. warning: comparison of integer expressions of different signedness: int and std::vector::size_type {aka long unsigned int}
Can someone tell me why this gives an error? Please.
warning: comparison of integer expressions of different signedness: int and std::vector::size_type {aka long unsigned int}
#include #include using namespace std; //Function to Sort The Vector. void SortVector(vector & v) { int vector; //Bubble sort Algorithm. for (int i = 0; i for (int j = 0; j
if (v[j] > v[j+1]) { vector = v[j]; v[j] = v[j+1]; v[j+1] = vector; } } } }
int main() { int vec, num; vector v; cin >> vec; for (int i = 0; i cin >> num; //Push Back Function v.push_back(num); } SortVector(v); for (int i = 0; i cout } cout return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started