CS50x threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2: [Arrays] – Functions, Variable and Scope, Debugging, Arrays, and Command Line Arguments › Seeking help of structure of argc and argv in Caesar project
- This topic is empty.
-
AuthorPosts
-
February 3, 2022 at 6:11 am #187
To my little understanding, there are 3 arguments to be entered through command line interface by the user.
-
./caesar will be first argument.
-
key will be second.
-
Entered text by user will be third.
Now, above three are translated into argv as follow:
-
argv[0] will be ./casear (taken care by default and so not needed to code inside main body).
-
argv[1] will be for key.
-
argv[2] will be for entered text
First, I need to ensure if I am correct in my approach. If so, then to relate argv[1], argv[2] inside the main body, manipulate from string to integer type…
To my little understanding, there are 3 arguments to be entered through command line interface by the user.
-
./caesar will be first argument.
-
key will be second.
-
Entered text by user will be third.
Now, above three are translated into argv as follow:
-
argv[0] will be ./casear (taken care by default and so not needed to code inside main body).
-
argv[1] will be for key.
-
argv[2] will be for entered text
First, I need to ensure if I am correct in my approach. If so, then to relate argv[1], argv[2] inside the main body, manipulate from string to integer type…
To my little understanding, there are 3 arguments to be entered through command line interface by the user.
-
./caesar will be first argument.
-
key will be second.
-
Entered text by user will be third.
Now, above three are translated into argv as follow:
-
argv[0] will be ./casear (taken care by default and so not needed to code inside main body).
-
argv[1] will be for key.
-
argv[2] will be for entered text
First, I need to ensure if I am correct in my approach. If so, then to relate argv[1], argv[2] inside the main body, manipulate from string to integer type…
Reply
https://edstem.org/us/courses/176/discussion/1083632?comment=2474412[learn_press_profile]
-
-
AuthorPosts
- You must be logged in to reply to this topic.