12.6k views
4 votes
when running the compiler in this task, we had to write "skm clang++ *.cpp" – Why did we need to use an * asterisk instead of writing the normal ?

User Jdimona
by
7.8k points

1 Answer

3 votes

Final answer:

The asterisk (*) in the compiler command is used for wildcard matching, telling the compiler to compile all '.cpp' files in the directory without listing each file individually.

Step-by-step explanation:

The use of an asterisk (*) in the command "skm clang++ *.cpp" when running the compiler is to indicate that the compiler should compile all files with a .cpp extension present in the current directory. This is a feature of the command shell that allows for wildcard matching, where the asterisk matches zero or more characters. In this case, it is used to match all files that have the same extension, simplifying the process of compiling multiple source code files without having to list them individually.

User Steve Prentice
by
8.2k points