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

c array of strings

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

PREVIOUS NEXT
Code Example
C :: c check if character is an alphabet 
C :: solana-test-validator log 
C :: pointer to function c 
C :: declare variables arduino 
C :: how to read 2d array from a file in c 
C :: how to get the lowest number on a array in c 
C :: delay in c programming for windows 
C :: getchar in c 
C :: C - program to create 1D array 
C :: c print 2d array 
C :: KneesDev 
C :: size of pointer in c 
C :: Turn on the first n Bits in number 
C :: c program to find minimum of 5 numbers using conditional operator in c 
C :: stddef.h 
C :: c read binary file 
C :: integer in c 
C :: check for duplicates c 
C :: c arrays and pointers 
C :: what does packing mean in c 
C :: fine print serial key 
C :: parcel-builder put image in sub folder 
C :: How to include multiline conditional inside template literal 
C :: can torch light bring change in chemical reaction 
C :: execute asm in c 
C :: How to scale all columns in dataframe in R? 
C :: Writing tests for API requests 
C :: Convert arduino String to C language String 
C :: C program determines the height status for heights in cm 
C :: C Create union variables 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =