Multidimensional Arrays

Using malloc() within Multi-dimensional Arrays in C.

Multiple dimensions with arrays in C.

Date Created:Tuesday May 08th, 2007 04:10 PM
Date Modified:Sunday August 03rd, 2008 12:37 PM

* Author: Dan Lynch

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

void getnamechar ** xint z);
void searchnamechar ** xint n);

int main() {
    char name[4];
    return 0;

void getnamechar ** xint n) {
    int i;
    char ch[21];
    for (i=0i<ni++) {
        printf("Enter Name %d>",i);
        strcpy(x[i], ch);

void searchnamechar ** xint n) {
    int i;
    char q;
    printf("Type a word to search in the array:");
    for (i=0i<ni++)
        if (!strcmp(x[i],q)) printf("Match in element x[%d]!\n",i);
        else printf("No match for %s\n",x[i]);

Download: code.c 718 B

Please login or Click Here to register for downloads
Creative Commons License
Multidimensional Arrays by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at
Permissions beyond the scope of this license may be available at