if argv == string

#include <iostream>
#include <string>

int main(int argc, char* argv[]) {
    if (argc > 1) {
        std::string arg = argv[1];
        std::cout << "Argument provided: " << arg << std::endl;
    } else {
        std::cout << "No arguments provided." << std::endl;
    }
    return 0;
}

This C++ program includes necessary libraries and defines the main function. The argc variable represents the number of arguments passed to the program, and argv is an array containing those arguments as strings. The program checks if there's at least one argument (argc > 1). If an argument exists, it converts the second argument (argv[1]) to a C++ string (std::string arg = argv[1];) and then prints it out. If no arguments are provided, it prints a message stating so. Finally, the program returns 0 to indicate successful execution.