How to find the length of argv[] in C

后端 未结 8 2110
青春惊慌失措
青春惊慌失措 2020-12-15 06:41
#include 
#include 
#include 

int main(int argc, char *argv[]){
    int fir; //badly named loop variable
    char *in         


        
8条回答
  •  猫巷女王i
    2020-12-15 07:09

    //Task = get length of argv
        string text=*argv; //assigning charValue to string variable "text"
        int l=text.length(); //getting the length of the string & assigning to variale "l"
    
        //this loop just outputs result on the screen
        for (int i=0; i

提交回复
热议问题