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

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




createArray()

 
Reply to this topicStart new topic

createArray()

sknox1
22 Oct, 2006 - 09:19 AM
Post #1

New D.I.C Head
Group Icon

Joined: 30 Sep, 2006
Posts: 29


Dream Kudos: 150
My Contributions
[quote]

Is there anyone out there that can explain this code to me and show me how to implement it?

[code]
Double*createArray(int size, double initValue);
User is offlineProfile CardPM
+Quote Post

NyeNye
RE: CreateArray()
22 Oct, 2006 - 10:07 PM
Post #2

D.I.C Head
**

Joined: 24 Sep, 2006
Posts: 248


My Contributions
Well the besting we could do about your posed is to show what your trying to accomplish...
User is offlineProfile CardPM
+Quote Post

gregoryH
RE: CreateArray()
23 Oct, 2006 - 12:01 AM
Post #3

D.I.C Regular
Group Icon

Joined: 4 Oct, 2006
Posts: 417


Dream Kudos: 50
My Contributions
QUOTE(sknox1 @ 22 Oct, 2006 - 10:19 AM) *


Is there anyone out there that can explain this code to me and show me how to implement it?

Double*createArray(int size, double initValue);

Look's to me like the implementation does two things:
  1. allocate the array space
  2. fill each space with the init value
To allocate space, are you using C or C++?

Filling the array is just assigning initValue to each member

This post has been edited by gregoryH: 23 Oct, 2006 - 04:07 AM
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: CreateArray()
23 Oct, 2006 - 03:56 AM
Post #4

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
QUOTE
To allocate space, are you using C or C++?


By looking at his variable naming convention, it looks like he's a Java Programmer...and Java Programmers usually use C++ and prefer to stay away from C.

But this is just an assumption.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 03:05AM

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