Answer the question
In order to leave comments, you need to log in
How to assemble c++ code in Visual Studio 2015 in size and speed?
Good afternoon, how to translate into assembler code in size and speed using the bubble algorithm as an example? And what are the fundamental differences in the assembler code between size and speed optimization?
#include <iostream>
using namespace std;
int length, a[100];
void bubble_sort() {
for (int i = 0; i < length-1; i++) {
for (int j = 0; j < length-i-1; j++) {
if (a[j] > a[j+1]) {
int b = a[j]; //change for elements
a[j] = a[j+1];
a[j+1] = b;
}
}
}
}
int main() {
cin >> length;
for (int i = 0; i < length; i++) {
cin >> a[i];
}
bubble_sort();
for (int i = 0; i < length; i++) {
cout << a[i] << " ";
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question