Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,843 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,378 people online right now. Registration is fast and FREE... Join Now!




trying to initialize variables in main() using a function

 
Closed TopicStart new topic

trying to initialize variables in main() using a function

Phantom_of_the_opera
7 Feb, 2007 - 07:33 PM
Post #1

New D.I.C Head
*

Joined: 13 Nov, 2006
Posts: 43


My Contributions
-

This post has been edited by Phantom_of_the_opera: 3 May, 2007 - 10:46 AM
User is offlineProfile CardPM
+Quote Post

GWatt
RE: Trying To Initialize Variables In Main() Using A Function
7 Feb, 2007 - 07:46 PM
Post #2

human inside
Group Icon

Joined: 1 Dec, 2005
Posts: 2,356



Thanked: 31 times
Dream Kudos: 500
My Contributions
What are you trying to accomplish? Just to set up the value of words, lines and paragraphs? If that is indeed what you are trying to accomplish, then I suggest you use pointers.
User is offlineProfile CardPM
+Quote Post

ByteWyse
RE: Trying To Initialize Variables In Main() Using A Function
7 Feb, 2007 - 07:59 PM
Post #3

New D.I.C Head
*

Joined: 2 Jan, 2007
Posts: 41


My Contributions
The parameters of initialize() must be either pointers or references in order for the original arguments to be changed.

Also, are you wondering what initialize() should return? It's not necessary that it return anything if you don't need it to, although you will need to change its return type to 'void'.

User is offlineProfile CardPM
+Quote Post

Closed TopicStart new topic
Time is now: 1/8/09 10:09AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month