A method of traversing the number of array of function parameters in C language array

Source: Internet
Author: User

//the method of iterating the number of array function parameters without passing arrays#include <stdio.h>#include<stdlib.h>#include<string.h>voidPrintfak (Char**pin) {    inti =0; //key point: Pin[i]!=null is the terminating condition     for(i =0; Pin[i]!=null; i++) {printf ("%s\n", Pin[i]); }}voidMain () {//the last element of an assignment array is 0//after the actual detection null,0, the meaning of ' "" is 00000    Char* strarr1[] = {"123","456","789", NULL}; Char* strarr2[] = {"123","456","789",' /' }; Char* strarr3[] = {"123","456","789",0 }; printf ("%x\n", STRARR1); printf ("%x\n", STRARR2); printf ("%x\n", STRARR3); //a new method of array traversal without passing the number of array elementsPrintfak (STRARR1); System ("Pause");}

A method of traversing the number of array of function parameters in C language array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.