c++ - error: expected constructor, destructor, or type conversion before ‘main’ -


i trying figure out how jump 1 function come , preform another. when compile error

error: expected constructor, destructor, or type conversion before ‘main’ 

here code:

#include <iostream> #include "32pm.cpp"  pm()  int main() {   std::cout << "hello world!"; } 

a function call followed semicolon, statement. statements can used in function body. e.g. in body of main.


note declarations in c++ come in 2 flavors: block declarations, can used statements in blocks, , non-block declarations, can (directly) used outside functions.

e.g. variable declaration block declaration, , namespace definition (or matter full function definition) non-block declaration.

it's arbitary, essence there divide between constructs can used statements, , cannot, , part of c++ grammar.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -