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 :: Compile multiple C files 
C :: c file struct 
C :: c comment 
C :: c unused parameter 
C :: scopes in c 
C :: hash function in c 
C :: writing structures in c 
C :: pointer c 
C :: how to read and write to fiel n c 
C :: C How to define a union? 
C :: insse suprafata arabila pe ani 
C :: bcd to char c 
C :: largest value in u64 
C :: ouverture du fichier c 
C :: how to find adam number uasing loop in C 
C :: remove language from jupyter notebook 
C :: scranton inhabitants 
C :: abs() for floting point in C 
C :: table de hachage en c 
C :: Dynamic Memoray alocation For 2D 
C :: Clearing The Input Buffer In C/C++ 
C :: C Common mistakes when working with pointers 
C :: what is the difference between algorithm and flowchart in c program 
C :: changing data type in one line c program 
C :: C program to Increase 1 to all of the given Integer Digit 
C :: payement des véhicules a la sortie de station de langue c 
C :: letter in alphabet or not 
C :: calculate max of three numbers using ternary operator in c 
C :: C Program to calculate the total execution time of a program 
Dart :: How to attach a FloatingActionButton to the AppBar 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =