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

+6 votes
29 views
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
asked Oct 3 in Science by gary


3 Answers

+2 votes
Are you makong computer software?
answered Oct 3 by Puppy (2,090 points)
+1 vote
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
answered Oct 4 by knightstar✧ (287,340 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.
Oh, thank goodness lol.
+1 vote

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[]) {
   .
   .
   .
}
answered Oct 5 by Kitten (273,880 points)

Related questions

+6 votes
14 answers
+6 votes
1 answer
+8 votes
7 answers
326 views asked May 17, 2016 in Other by Horselover101
+6 votes
2 answers
37 views asked May 27 in How-To by Ammy-K (17,460 points)
+5 votes
4 answers
+7 votes
5 answers
+10 votes
2 answers
+8 votes
4 answers
+6 votes
2 answers
+5 votes
0 answers
+4 votes
1 answer
+8 votes
0 answers
44 views asked Apr 9, 2016 in Other by ❤️GryffindorGal❤️ (111,430 points)
+7 votes
1 answer
51 views asked Apr 9, 2016 in Other by ❤️GryffindorGal❤️ (111,430 points)
+5 votes
1 answer

Recent Badges

Notable Question
- TylerTheDrummer -
Nice Question
- Cindy7872 AJ -
Popular Question
- Vanilla Bean -
Notable Question
- lypi123 -
1,000 Club
- Crafter4017 -
...