cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
calling functions
calling functions
May 17, 2012 at 11:50pm UTC
ibrahim Mohamed
(4)
can i call a function declared after the function i'm calling it in?
for example:
int fun1()
{
fun2();
return 0;
}
int fun2()
{
return 0;
}
and if yes how can i do it?
May 17, 2012 at 11:52pm UTC
Peter87
(11234)
You can do that if you declare the function before you call it.
1
2
3
4
5
6
7
8
9
10
11
12
int
fun2();
int
fun1() { fun2();
return
0; }
int
fun2() {
return
0; }
May 17, 2012 at 11:56pm UTC
ibrahim Mohamed
(4)
tried it and its working perfectly
thanks dude
May 18, 2012 at 12:41am UTC
John McCrary
(11)
yeah, it's hard to try to make a complex program without calling user-defined functions inside other user-defined functions... its like functionception...
Topic archived. No new replies allowed.