@BroCodez

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

int main()
{
   char cars[][10] = {"Mustang","Corvette","Camaro"};

   //cars[0] = "Tesla";
   strcpy(cars[0], "Tesla");

   for(int i = 0; i < sizeof(cars)/sizeof(cars[0]); i++)
   {
      printf("%s\n", cars[i]);
   }

   return 0;
}

@benoitgauthier6089

One VERY important point when using strcpy() that really should have been mentionned:
The destination string should be large enough to accept the source string. Otherwise, it will overflow on other memory adresses and potentially corrupt your program

@alexiosalexiou3180

Thanks, simple, straight to the point, analytical.

@farragoprismproductions3337

For those who are dumb like me, the reason why he used two brackets for assigning an "array of strings" is because of "an array of characters and the array of strings composed of those characters" .  A string in the C language is simply a list of characters , but C prefers to associate it with the object known as an array , among other programming languages. So, having a list of words will usually entail creating a variable that stores two types of arrays, therefore it's important to use two brackets for what would then be a 2-dimensional array .

Definitions -

1. 2-dimensional Array: [The incorporation of an array/list of elements that would intuitively involve the combination of two arrays.]

2. Arrays: [ 1.) A list of elements that can be manipulated in a coding project, assigned with at least a single bracket. 2.) A type of object in the C programming language.]

3. String: [A type of array that consists of characters.]

4. Characters: [ 1.) A data type in the C programming language, which represents a letter in the alphabet. 2.) A type of element that can be used in an array.]

5. Element: [A value that is stored in an array]

6. Bracket/Index Notation: [A notation that's used for indexing elements, but is used for limiting the number of possible elements within an array.]

@mohammedazzan7529

yours was the simplest to understand thank you.

@kevser176

ı really couldnt get this topic but now everything is clear. thanks you are the best🥺

@EasyMathematics01

0:27 hello Bro, i am watching from Nepal. Mustang district  is located in my country which is very popular for tourism and Himalayas. anyway thank u so much for your best teaching style sir. ❤❤❤

@movieyouser

Sir, you are the help I needed

@marbles5590

Thank you for this video! It can also be *cars[ ] in order to not have wastage of memory

@minari_0324

damn you made our 30-60 min lecture into 3 mins

@MainulHossainAnik

DONE❤❤

@DarkDevilVaqif

10k subs in a day nice

@bernardev3

THANKS BRO!!!!

@moaz_king_1001

thanks for help :)

@TheLivingCrittles

I dont understand the math for the for loop... sizeof(cars) would be 2, since 0 counts as an index. sizeof(cars[0]) is Tesla, which is 5 characters... so wouldn't you be comparing 0, 1, and 2 against 2/5 which is 0.4? so shouldn't the loop break after the first element? so confused...

@kevser176

ı wish ı can like this video multiple times

@arkabrian5796

THANK YOU SO MUCH!!!

@umutaydn6184

thanks alot!

@sebastienroux1790

Can you replace for example "tesla" with a variable that ="tesla" ?