Błędna kompilacja na ideone - standard input is empty

0

Witam,
w jaki sposób wkleić poniższy kod na ideone, aby nie wyrzuciło błędu kompilacji?

#include <iostream>                 
#include <cmath>                    

using namespace std;                

int nal0(string dana) {             
   int pom = 0;                    
   int dl = dana.length();         
   for (int i = 0; i < dl; i++) {  
   int x = int(dana[dl-i-1]) - 48; 
   pom = pom + x * pow(2, i);
}
   return pom;                     
}

int main() {
   cout << na10("101010") << endl;          
   cout << na10("110101") << endl;          
return 0;
}
2

Przecież jest konkretny komunikat błędu:

prog.cpp: In function ‘int main()’:
prog.cpp:17:13: error: ‘na10’ was not declared in this scope
     cout << na10("101010") << endl;
             ^~~~
prog.cpp:17:13: note: suggested alternative: ‘nal0’
     cout << na10("101010") << endl;
0

@overcq: Ale ja nie wiem o co chodzi?

0

@overcq: A juz rozumiem dzięki

0

@overcq: Wiesz może co to za błąd:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status ```

1 użytkowników online, w tym zalogowanych: 0, gości: 1