Me salen los siguentes errores.. :C
Código
13 12 [Error] expected identifier before numeric constant 13 15 [Error] expected '{' before ';' token 13 15 [Warning] lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default] 13 15 [Error] invalid user-defined conversion from 'main()::__lambda0' to 'int' [-fpermissive] 13 14 [Note] candidate is: main()::__lambda0::operator void (*)()() const <near match> 13 14 [Note] no known conversion for implicit 'this' parameter from 'void (*)()' to 'int' 25 15 [Error] invalid conversion from 'int' to 'int*' [-fpermissive] 8 6 [Error] initializing argument 1 of 'void ordenar(int*)' [-fpermissive] 26 16 [Error] invalid conversion from 'int' to 'int*' [-fpermissive] 9 6 [Error] initializing argument 1 of 'void imprimir(int*)' [-fpermissive]
Código
#include <cstdio> #include<stdlib.h> #include<time.h> #include<conio.h> using namespace std; void ordenar (int ord[]); void imprimir (int impri[]); int main () { int num=[50]; int i=0; int limite_inf=1, limite_sup=100; srand (time(0)); for (i=0; i<50; i++) { printf("rand ()"); printf("Numero %d: ", i); printf("%d\n", num); } ordenar (num); imprimir (num); system ("pause"); return 0; } void ordenar (int ord[]) { int i=0, j=0, aux=0; for (i=0; i<50; i++) { for (j=i; j<50-1; j++) { if (ord[i] < ord[j]) { aux = ord[i]; ord [i] = ord[j]; ord [j] = aux; } } } } void imprimir (int impri[]) { int i=0; for (i=0; i<50; i++) { printf ("%d" , impri [i]); } printf ("\n\n"); }