포인터 배열 및 c

코드 예제

0
0

N

int main(int argc, char *argv[])
{	// declare an array
    char *card_deck[] = {"Joker", "one", "two", "three", "four",
    					"five", "six", "seven", "eight", "nine",
                        "ten", "Jack", "Queen", "King"};
    // declare a point and make it point to the array;
  	// You need two ** because an array is a pointer to the first element in the array
  	// So you need a pointer to a pointer AKA double pointer
    char **ptr = card_deck;
    
    for (int deck = 0; deck <= 13; deck++)
    {
      	// Now you can increment the ptr in a loop and print all the elements of the array.
        ptr++;
        printf("\ncard deck %s", *ptr);
    }

비슷한 페이지

예제가있는 유사한 페이지

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................