Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions