Search
 
SCRIPT & CODE EXAMPLE
 

C

array of strings in c

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#define MAX_LENGTH 100
#define NUM_STRINGS 10

int main(){
    char *arr3[NUM_STRINGS] = { "first string",
                                "second string",
                                "third string",
                                "fourth string",
                                "fifth string" };
    char* str1 = "string literal";
    arr3[8] = str1;
    arr3[9] = "hello there";

    for (int i = 0; i < NUM_STRINGS; ++i) {
        printf("%s, ", arr3[i]);
    }
    printf("
");

    exit(EXIT_SUCCESS);
}
Comment

array of strings in c

char ch_arr[3][10] = {
                         {'s', 'p', 'i', 'k', 'e', ''},
                         {'t', 'o', 'm',''},
                         {'j', 'e', 'r', 'r', 'y',''}
                     };
Comment

string array in c

char ch_arr[3][10] = {
                         "spike",
                         "tom",
                         "jerry"
                     };
Comment

c array of strings

char commands[][4] = {
        "add",
        "prn",
        "lea",
        "inc",
        "mov"
};
Comment

c array of string

char *A[] = {"Ahmet", "Mehmet", "Bülent", "Fuat"};
Comment

array of string in c

const char *a[2];
a[0] = "blah";
a[1] = "hmm";
Comment

PREVIOUS NEXT
Code Example
C :: how to declare a structure in c 
C :: how to write a hello world program in c 
C :: how to get value of multidimensional array in c 
C :: time now C 
C :: free array in c 
C :: crear funcion en c 
C :: filing in c 
C :: visual studio code 
Dart :: debug banner flutter 
Dart :: navigator.pushandremoveuntil flutter 
Dart :: flutetr stepper color 
Dart :: Waiting for another flutter command to release the startup lock... 
Dart :: flutter appbar width 
Dart :: flutter text color 
Dart :: dart datetime difference 
Dart :: flutter chip avatar radius increases 
Dart :: flutter chip labelstyle 
Dart :: flutter navigation pop 
Dart :: increase text size of Test flutter 
Dart :: how to disable screen rotation in flutter 
Dart :: text in column flutter overflow ellipsis not working 
Dart :: flutter iconbutton 
Dart :: flutter dictionary example 
Dart :: looping through a list dart 
Dart :: getting pi in flutter 
Dart :: hide keyboard in flutter 
Dart :: flutter layout builder 
Dart :: dart comments 
Dart :: snackbar flutter 
Dart :: dart null aware 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =