C/C++ : Passing Argument

I want create program with C/C++ with passing argument feature. We can input string, integer or float from this argument input. Create a file with name main.c and paste this code :

Compile this code with command :

gcc main.c -o cpassingarg

This is output from this program :

This is an example how to create program with C/C++ with passing argument feature. We can convert string to other type (string to integer, string to float) with sscanf command.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.