0 votes 0 votes Can we declare a variable in main() which we will be using in another function? And why? ranarajesh495 asked Oct 10, 2018 ranarajesh495 332 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Magma commented Oct 10, 2018 reply Follow Share What I know is yes but yeah I just run this code...and got error 0 votes 0 votes ranarajesh495 commented Oct 10, 2018 reply Follow Share @magma Can you check the code by removing void in function return type or replace ' &a' with a int variable? I still can not figure out what is the meaning of &a argument 0 votes 0 votes Shaik Masthan commented Oct 10, 2018 reply Follow Share you may use like void main () { int a = 12; Magma(&a); } void Magma (int *p) { (*p)++; // *p means a } 0 votes 0 votes Please log in or register to add a comment.