#include <vector>#include <iostream>int main(void){ std::vector<int> container = {11,3,5,6,200}; for (size_t i = 0; i < container.size(); ++i) { if(container[i]==5) printf("Position:\n" [i+1]); } return 0; }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:10:28: error: invalid conversion from 'char' to 'const char*' prog.cpp:10:28: error: initializing argument 1 of 'int printf(const char*, ...)'
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!