Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Safe Array Access | Working with Array Elements
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C++ Arrays

bookChallenge: Safe Array Access

Tarea

Swipe to start coding

Write a function sumArray that takes a constant integer array and its size as parameters and returns the sum of all elements in the array.

  • Access only valid indices in the array (from 0 to size - 1);
  • Do not use any global variables or additional libraries;
  • Declare and initialize the array in main, then pass it with its size to sumArray;
  • Return the total sum from the function.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 3
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me an example?

close

bookChallenge: Safe Array Access

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a function sumArray that takes a constant integer array and its size as parameters and returns the sum of all elements in the array.

  • Access only valid indices in the array (from 0 to size - 1);
  • Do not use any global variables or additional libraries;
  • Declare and initialize the array in main, then pass it with its size to sumArray;
  • Return the total sum from the function.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 3
single

single

some-alt