Skip to content

LucasLarson/AppleParameter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9aa90ac Β· Dec 20, 2023
Dec 20, 2023
Aug 18, 2020
May 11, 2020
May 8, 2020
Aug 18, 2020
Nov 7, 2020
Jul 8, 2020
Sep 17, 2020
Oct 29, 2020
May 9, 2020
May 9, 2020
May 13, 2021
Dec 20, 2023
Nov 7, 2020
Oct 9, 2020
Mar 2, 2022

Repository files navigation

AppleParameter

Gitpod Ready-to-Code Gitter chat Donate CodeFactor

What is apple[0] of int main()?

In the C family of languages, there are typically zero or two β€“ or sometimes three β€“ parameters on the int main() function. The first two are usually argc and argv. When there’s a third, it’s often envp.

  • What happens when you add a fourth parameter apple?
  • What if your compiler has a defined macro __APPLE__?
  • What if apple’s not an int:
    • What if it’s a double pointer char **apple?
    • What if it’s a two-dimensional array char apple[][]?
    • What if the apple parameter’s an array of pointers char *apple[]?
      • What is the content of apple[0]?