Answers for "search replace 2d array elements"

0

search replace 2d array elements

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

int main()
{
  char newword;
  char array[100][20]={
    {'H','e','l','l','o'},
    {'W','o','r','l','d'},
 };
    printf("%s\n",array[0]);
    printf("%s\n",array[1]);

    printf("Type a new word: ");
    scanf("%s",&newword);

    strcpy(array[1],&newword);
    printf("%s\n",array[0]);
    printf("%s\n",array[1]);

   return 0;
 }
Posted by: Guest on September-23-2021

Code answers related to "search replace 2d array elements"

Browse Popular Code Answers by Language