Go Back   Flash Flash Revolution > General Discussion > Critical Thinking > Homework & Help
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09-12-2015, 12:23 AM   #13
llyair
Wiki Staff
Retired StaffFFR Veteran
 
llyair's Avatar
 
Join Date: Jun 2014
Posts: 307
Default Re: [University - C++ Programming] Filling an Array with RNG & Display Contents

Quote:
Originally Posted by FoJaR View Post
also i'm not sure what your teacher's policy on
Code:
using namespace std
is but generally it is not the best idea
Agreed about the using namespace std, but I guess code style can be fixed after you have something running and understand it.

Quote:
Originally Posted by sickufully View Post
I'm confused by the fact that Display has been initialised before Main and then it's then called twice, but once within Main and once again outside of it. Can someone explain this to me? More along the lines of what does the first Display call do?
This page explains different uses of function names:
http://www.cprogramming.com/declare_vs_define.html

It also has a really simplified example, but it's similar to what you have with Display() showing up three times. Just copying the code here for convenience:
Code:
int func();

int main()
{
    int x = func();
}

int func()
{
    return 2;
}
See the section with this code, it'll explain the reason for func() showing up 3x.
llyair is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution