C – (pointer transfer parameter) primary pointer transfer parameter


void print(int* ptr, int sz)
    int i = 0;
    for (i = 0; i < sz; i++)
        printf("%d ", *(ptr + i));

int main()
    int arr[10] = { 1,2,3,4,5,6,7,8,9,10 };
    int* p = arr;
    int sz = sizeof(arr) / sizeof(arr[0]);

    //When the pointer is passed to the first level, the parameter of the pointer is passed to the first level

    char ch = 'w';
    char* p1 = &ch;

    return 0;


Recommended Today

How to configure Jenkins through yaml file

Install Jenkins docker run -d –name jenkins-master -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime –restart=always jenkinsci/blueocean After successful startup, log in to Jenkins and the initial password path is:/var/jenkins_home/secrets/initialAdminPassword。And install Jenkins configuration as code (a.k.a. jcasc) plugin. The jcasc plug-in supports the use of yaml filesjenkins.yamlTo configure the Jenkins instance, it does not support […]