KidzTalk

How do you return a pointer to an array in C++?

+10 votes
97 views
asked Oct 3, 2019 in Science by gary
Im am only 7 yers old so i need abit of help witrh this. How do i return a pointer to an array from a function in c++. thanks guys


3 Answers

+1 vote
answered Oct 5, 2019 by pumpkin (679,430 points)

Way-1

Formal parameters as a pointer as follows −

void myFunction(int *param) {
   .
   .
   .
}

Way-2

Formal parameters as a sized array as follows −

void myFunction(int param[10]) {
   .
   .
   .
}

Way-3

Formal parameters as an unsized array as follows −

void myFunction(int param[]) {
   .
   .
   .
}
commented Dec 18, 2019 by pumpkin (679,430 points)
did this help?
+1 vote
answered Oct 4, 2019 by im kanye (373,640 points)
I'm in 7th grade and I have no idea what you are talking about, and I just don't know if I'm just dumb 'coz I'm doing okay at school
commented Oct 5, 2019 by pumpkin (679,430 points)
You are not dumb. C ++ is a computer software language that makes up the MS DOS and windows 96, XP, vista, 7, 8.1, and 10 operating systems. Most people just don't know that.
commented Oct 5, 2019 by im kanye (373,640 points)
Oh, thank goodness lol.
commented Dec 18, 2019 by pumpkin (679,430 points)
:D
+2 votes
answered Oct 3, 2019 by Puppy (3,910 points)
Are you makong computer software?

Related questions

+11 votes
18 answers 886 views
+1 vote
3 answers 67 views
asked Jul 31, 2020 in Other by Jane
+10 votes
1 answer 84 views
+1 vote
1 answer 44 views
asked Aug 5, 2020 in Other by Jane
+9 votes
18 answers 332 views
+7 votes
1 answer 109 views
+2 votes
2 answers 166 views
asked Aug 25, 2020 in Other by Jane
+9 votes
9 answers 559 views
asked May 17, 2016 in Other by Horselover101
+4 votes
1 answer 58 views
+1 vote
2 answers 127 views
asked Aug 27, 2020 in Other by Jane
+1 vote
2 answers 75 views

Recent Badges

Notable Question
Asked question received 50 views
- -GEMHeart- -
Notable Question
Asked question received 50 views
- Lesbian Wolf Furry -
Great Question
Question received +8 upvote
- PrincessJelly -
Notable Question
Asked question received 50 views
- PrincessJelly -
Nice Question
Question received +2 upvote
- -GEMHeart- -
...