Array of Strings

  Рет қаралды 145,349

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 180
@muthupriyadharshinim9033
@muthupriyadharshinim9033 5 жыл бұрын
Great Lectures.One of the best Educational Channels ever.Thanks a lot to team Neso Academy.
@ashishpradhan6503
@ashishpradhan6503 4 жыл бұрын
2 apples are lesser than 3 bananas Two reasons are there: 1.length of string 2 is greater than string 1. 2.ASCII code of 3 is greater than 2.
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
Length Never matters here...!!!! 3>2 only this part matters! you can check by decreasing the size of fruit[2] from "3 Bananas" to "3 Ban"... still result is same!
@ashishpradhan6503
@ashishpradhan6503 4 жыл бұрын
@@ericosmostech4903 yes u r correct. But here I was thinking if I modify the question a little bit i.e. fruits [2]= " 2 bananas " is replaced by " 2 apple" and compare it with fruits [1]=" 2 apples". ** it is 2 apple not 2 apples in place of 3 bananas..
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
@@ashishpradhan6503 Yes... You're right, if your thinking that way! :D
@aravindks7636
@aravindks7636 4 жыл бұрын
@@ericosmostech4903 please explain the index. because generally, in pointers fruits [2]=fruits[0]+2, then it will take to the 3rd element.but in this situation I can't see such a thing
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
@@aravindks7636 Yes Ofcourse, fruit[2] means the 3rd element of the array! comparing fruit[1] & fruit[2] means Comparing the 2nd & 3rd elements. can you tell me in detail which part you actually couldn’t get?
@prateekdubey7076
@prateekdubey7076 4 жыл бұрын
O/p-> 2 Apples are lesser than 3 Bananas Ps:-the evaluation/comparison will never go to A and B but 2 and 3 itself will decide the strcmp value i.e 0
@shvideo1
@shvideo1 2 жыл бұрын
Excellent tutorial. Very useful and to-the-point. Thank you for sharing.
@ranjanverma6588
@ranjanverma6588 4 жыл бұрын
2 Apples are lesser than 3 Bananas.........Thank you, sir, for such a wonderful lecture. Please upload File handling videos.
@taradevi8130
@taradevi8130 3 жыл бұрын
It will display the statement....2 Apples are lesser than 3 Bananas
@shivanshuchauhan6026
@shivanshuchauhan6026 4 жыл бұрын
Sir your vid lectures make us understand a lot about a topic very easily. But to be a good programmer we need a lot of practise. Please suggest some platforms where we can practise c++ topic wise.
@Raj_0028
@Raj_0028 5 жыл бұрын
Please upload data structures also . Asap sir
@mukulsharma8484
@mukulsharma8484 4 жыл бұрын
They are not listening dude
@sameerkaushik537
@sameerkaushik537 4 жыл бұрын
Please upload the data structure video
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
2 Apples are lesser then 3 Bananas >>> only because of 3 > 2 >>>Not because of length! Length doesn’t matter unless one of them is the subset of others !
@forgetfulfunctor1
@forgetfulfunctor1 2 жыл бұрын
Here's an interesting issue: string literals are stored in read only memory (data section of the executable) and hence immutable. He mentions this in an earlier video, too. the solution as I understand is to declare them as arrays rather than pointers, so that they will be allocated on the stack or heap. so here, either you must waste size because you must declare your inner array dimensions, or you must waste time (writing the code) by declaring each string as an array and then assigning it to an array element, individually Can anyone tell me if they agree/disagree?
@SachinGuy
@SachinGuy Жыл бұрын
Interesting work! There I would use them according to the use case.
@cuteonigiri1671
@cuteonigiri1671 Жыл бұрын
does it mean if we use array of pointers like in the video, we cannot make a change to the string bc it is stored in read only memory. only pointer to that string is being stored in the array?
@phani8482
@phani8482 Жыл бұрын
@@cuteonigiri1671 yeah
@mohamed_abdelrahman10
@mohamed_abdelrahman10 Жыл бұрын
you are right
@diversiontv777
@diversiontv777 11 ай бұрын
Yeah accordingly the pointer is passed instead of a string cuz they cannnot be viewed as a single value but can be accessed using pointer cuz they are stored in contagious memory blocks and the reason they are stored in contagious memory blocks is that they we written adjacent to each other and hence they get stored adjacently @@cuteonigiri1671
@abdulrubbinmohsin6111
@abdulrubbinmohsin6111 4 жыл бұрын
awesome lecture . sir kindly upload DATA STRUCTURE Lectures ASAP.
@staceyloulouse
@staceyloulouse 3 жыл бұрын
how do i assign the values of the string array during runtime (as input from user)?
@cemilbayhan1434
@cemilbayhan1434 4 жыл бұрын
Has your channel a video explaining the functions(malloc,calloc etc.)? Also thanks for this video. Thanks @Neso Academy
@nbk330
@nbk330 4 жыл бұрын
watch videos in this playlist.. u will get it.. do some exercise.. n u will find it easily...
@cemilbayhan1434
@cemilbayhan1434 4 жыл бұрын
@@nbk330 thanks a lot for reply :)
@vaishalivibestream
@vaishalivibestream 5 жыл бұрын
Thank you sir.... Very well explained..
@shambhavisrivastava2340
@shambhavisrivastava2340 2 жыл бұрын
Best channel on yt to learn coding. Hnds down 🙌🏼
@royalgamer174
@royalgamer174 3 жыл бұрын
learned a lot from your channel.
@letsbethechange481
@letsbethechange481 4 жыл бұрын
If part evaluated S1 is lesser than s2 ASCII DIFFERENCE B/W--->> A and B
@yahyashaikh8439
@yahyashaikh8439 2 жыл бұрын
Thank you so much sir my all doubt has been cleared in a very simple way God bless you your teaching way is perfect
@kunalsoni7681
@kunalsoni7681 5 жыл бұрын
sir this one is awesome presentation😘❤😗😙
@Memorable_days90s
@Memorable_days90s 3 жыл бұрын
Else part will execute because O is greater than A based on ASCII codes
@kokilavanil3775
@kokilavanil3775 4 жыл бұрын
f[0]=2 oranges f[1]=2 apples f[2]=3 bananas f[3]=1 pineapple If ( strcmp(f[1],f[2])
@daughter_of_chitkute0611
@daughter_of_chitkute0611 9 ай бұрын
2 and 3 is a character here so won't it be considered for the evaluation?
@examtechsolution2609
@examtechsolution2609 3 жыл бұрын
How we can input by user input
@msmanviyogi5191
@msmanviyogi5191 3 жыл бұрын
2 apples are lesser then 3 bananas. Thank you so much sir for wonderful Explanation .
@ajmalkhaniit
@ajmalkhaniit 4 жыл бұрын
Amazing tutorial!
@Bulbul_2820
@Bulbul_2820 3 жыл бұрын
Excellent lecture 🙂🙂keep it up
@saiajaygelli2380
@saiajaygelli2380 3 жыл бұрын
what is the answer if i change the question to strcmp(fruits[0] ,fruits[1]) in place of 1,2 i changed to 0,1 need to consider values of O,A or 2,2 (as it is point to first so 2,2 (i.e 2-2=0 undefined)) please reply neso😅
@satyad5285
@satyad5285 2 жыл бұрын
2 ORANGES ARE GREATER THAN 2 APPLES
@roshanmhatre8810
@roshanmhatre8810 4 жыл бұрын
When are stacks, queues and other data structures uploaded? Nice Course BTW
@aritrasarkar1557
@aritrasarkar1557 5 жыл бұрын
Please do course on computer science networking
@arunkumara3844
@arunkumara3844 5 жыл бұрын
It will be very useful
@yacinealiouane8859
@yacinealiouane8859 5 жыл бұрын
Thank u ser you helped me a lot ....please put more exercises 😍
@abishekbabu9247
@abishekbabu9247 4 жыл бұрын
@@nesoacademy sir where is the practice sheet
@dharu_22
@dharu_22 3 жыл бұрын
fruits[1]2
@akashpraveen9814
@akashpraveen9814 3 жыл бұрын
Post a video about size of pointers and size of various pointers..
@ayushimalviya6719
@ayushimalviya6719 4 жыл бұрын
Thanks sir... one of the best tutorial... Explanation is very clear...
@upendrakumarjha9245
@upendrakumarjha9245 3 жыл бұрын
Awesome way to teach.
@venkateshroyal7494
@venkateshroyal7494 3 жыл бұрын
fruits[1]
@GauravSharma-ev3mb
@GauravSharma-ev3mb 3 жыл бұрын
how to assign an element of array of string to different variable??? example : i wanted to storage the 2nd index value to a different variable x = 1 Pineapple for further opration on string 1 Pineapple.
@Hiyori___
@Hiyori___ 3 жыл бұрын
awesome lecture and now I also crave some fruits.
@mdrehan493
@mdrehan493 Жыл бұрын
It print the if condition
@MartinPHE
@MartinPHE 5 жыл бұрын
great stuff
@sairam_world
@sairam_world 2 жыл бұрын
Nice
@alfredchilini5518
@alfredchilini5518 5 жыл бұрын
keep going u r the best
@tails_the_god
@tails_the_god 2 жыл бұрын
Thanks neso academy!
@darkspin4848
@darkspin4848 4 жыл бұрын
I loved this video, but tbh I'm still looking for one answer - how does it work if I wanna add those items later on into the array? So let's say I created an array "*fruits" with the code but I want the customer to fill the array with whatever he bought. You know what I mean?:'D
@shakthisri8409
@shakthisri8409 3 жыл бұрын
#include int main() { int i,j=0,k; char fruits[2][100]; printf("number and fruit name: "); for(i=0;i
@shakthisri8409
@shakthisri8409 3 жыл бұрын
But only single line is printed
@darkspin4848
@darkspin4848 3 жыл бұрын
@@shakthisri8409 thank you!
@shakthisri8409
@shakthisri8409 3 жыл бұрын
@@darkspin4848 can u find the mistake in tat 🥺... it's printing only one line
@darkspin4848
@darkspin4848 3 жыл бұрын
@@shakthisri8409 I will get back to you as soon as I found an answer!!
@Animeshkumar206
@Animeshkumar206 4 жыл бұрын
What does pointer to the first character mean ?
@kavayashrisheelavant2913
@kavayashrisheelavant2913 4 жыл бұрын
Address of the first character of a string..
@rz1359
@rz1359 3 жыл бұрын
Thanks, informative
@InfinityYo
@InfinityYo 2 жыл бұрын
Sir suppose you want to take input as string using gets() in array of pointer then how it can be done?
@mohammedshaikh8343
@mohammedshaikh8343 2 жыл бұрын
thanks
@huycopper7534
@huycopper7534 2 жыл бұрын
thank you so much, this video is really useful
@hemanthkumargundumilli
@hemanthkumargundumilli 5 жыл бұрын
2 Apples are lesser than 3 Bananas
@vishallondhe7298
@vishallondhe7298 4 жыл бұрын
@@psarvani6994 do me a favour and study one dimensional arrays first, you will get why there are 2 apples and 3 bananas
@Victor-ti4fx
@Victor-ti4fx 4 жыл бұрын
@@vishallondhe7298 he just telling the answer why are you being a boomer?
@sahanasharon4294
@sahanasharon4294 Жыл бұрын
What is d use of arrays of strings ?
@smritipragya8633
@smritipragya8633 4 жыл бұрын
@neso academy plz give us the solution of homework problem
@abhishekkumarsandliya7805
@abhishekkumarsandliya7805 4 жыл бұрын
You may write the code in any online compiler and get your answer👍🏻
@JojoJojo-nt2pw
@JojoJojo-nt2pw Жыл бұрын
while declaration if we write "char** strs" what will it notify
@abhishekshetty8962
@abhishekshetty8962 4 жыл бұрын
when does the difference in length of two string cause a difference
@rking2788
@rking2788 3 жыл бұрын
How to take input using scanf?
@shashankmishra5329
@shashankmishra5329 5 жыл бұрын
sir please upload ds soon.
@akshatk1690
@akshatk1690 2 жыл бұрын
ans:- lesser than fruit[2]
@aniketsahi128
@aniketsahi128 2 жыл бұрын
else part will appears on the output screen.
@makwanaronik4587
@makwanaronik4587 3 жыл бұрын
Sir please upload the file handing video ..
@nesoacademy
@nesoacademy 3 жыл бұрын
kzbin.info/www/bejne/bpWVcmisotFsi7c
@smritipragya8633
@smritipragya8633 4 жыл бұрын
Plz make a separate vedio lecture on homework problem
@true4189
@true4189 3 жыл бұрын
Thank u
@adityasaxena6619
@adityasaxena6619 4 жыл бұрын
char *fruits[]={"2 Oranges","2 Apples","3 Bananas","1 Pineapple"}; printf("%d",sizeof(fruits)); please explain what and why will be the answer.
@vasireddyganesh
@vasireddyganesh 4 жыл бұрын
I think it would return size of 4 char pointers... But iam not sure of it.. Plz let me know if iam wrong..
@mayursb2259
@mayursb2259 4 жыл бұрын
32
@PLATONU
@PLATONU 4 жыл бұрын
your code only works if the file ends .c, so if it ends .cpp it will give an error " iso c++ forbids converting a string to char* " or something like that; so if you can't choice and you die with cpp, must change the code to: const char * fruits[] = { "aples", ...}; yes, just add "const" at the left of char *
@ichaa3tech
@ichaa3tech 4 жыл бұрын
The playlist title is C programming not c++ programming.
@sahil8565
@sahil8565 3 жыл бұрын
but what if we want to input the strings ?
@vaibhavsharma9298
@vaibhavsharma9298 2 жыл бұрын
2 Apples are lesser than 3 Bananas ( cause APPLES_/0 ll be compare BANANAS/0 . Rest of place in APPLES _is less means white space ⬆️ is lesser than S ,, Rest place Value of ASCII table is 32 and S value of ASCII table is 115 ) if u don't understand this .. So u will go and see a video of strcmp in neso lectures and check 2 condition )
@ingenierocristian
@ingenierocristian 2 жыл бұрын
Please, tell me you have a channel on Odysee!!
@theragarlanagamani4317
@theragarlanagamani4317 Жыл бұрын
Fruit 2 is great than fruit 1
@yagneshacharya2461
@yagneshacharya2461 2 жыл бұрын
WHY WE DOESN'T USE 1D ARRAY WITHOUT POINTERS ?
@vaibhavsharma9298
@vaibhavsharma9298 2 жыл бұрын
Brother we use obviously ,but if u recall a just previous video he said use of array of pointers (save a waste memory) ... 🚯 So which of he had used a pointers array
@yagneshacharya2461
@yagneshacharya2461 2 жыл бұрын
@@vaibhavsharma9298 thanks for info
@EngRiadAlmadani
@EngRiadAlmadani 5 жыл бұрын
wow
@the_ocean_eyes
@the_ocean_eyes 2 жыл бұрын
Fruits [1] are lesser than fruits[2]
@newsdaily5186
@newsdaily5186 3 жыл бұрын
what if this to be done in CPP pls some body help me?
@manasaravula2744
@manasaravula2744 3 жыл бұрын
Pls tell me any one
@xboxlox
@xboxlox 3 жыл бұрын
the name of the array is also the pointer to the first element inside it so it is aleady acting as a pointer so why adding an asterisk ✳??
@bhoomikabhoomi2989
@bhoomikabhoomi2989 3 жыл бұрын
2>0 output
@telvinhoward6741
@telvinhoward6741 Жыл бұрын
guys please tell me why this is giving error and how can i fix it #include using namespace std; int main() { char *fruits[5]; for(int i=0;i
@atulnegi20
@atulnegi20 Жыл бұрын
Abeee lodu🎉🎉
@karmakaraayon4238
@karmakaraayon4238 Жыл бұрын
output: 2 Apples are lesser than 3 Bananas
@indiancoder8301
@indiancoder8301 4 жыл бұрын
If gets evaluated
@bachinaganesh1891
@bachinaganesh1891 3 жыл бұрын
First if block executed..... 😱😱😱😱
@bhoomikabhoomi2989
@bhoomikabhoomi2989 3 жыл бұрын
2,3
@matrixxhunt7401
@matrixxhunt7401 4 жыл бұрын
2 oranges are greater than 2 Apples
@manasaravula2744
@manasaravula2744 3 жыл бұрын
Array of strings and string arrays are same are not
@ayashakumarimandal8681
@ayashakumarimandal8681 2 жыл бұрын
Homework: 2 Apples r lesser than 3 Bananas
@abhisheksinghmehra9576
@abhisheksinghmehra9576 2 жыл бұрын
2 apples are lesser than 3 bananas ==>answer
@nirbhayparmar
@nirbhayparmar 4 жыл бұрын
2 apples are less than 3 banan
@adnansarkar9219
@adnansarkar9219 2 жыл бұрын
2 apples are lesser than 3 bananas
@rakshitrk7893
@rakshitrk7893 3 жыл бұрын
2 apples are lesser than 3 banana
@moeintaherkhani7289
@moeintaherkhani7289 Жыл бұрын
Answer to HW: 2 Apples are less than 3 Bananas
@sumanasriudumula6817
@sumanasriudumula6817 5 жыл бұрын
Is the answer 2 Apples are greater than 3 Bananas
@ArjunDev17
@ArjunDev17 5 жыл бұрын
No, 2 Apples are lesser than 3 Bananas
@vishallondhe7298
@vishallondhe7298 4 жыл бұрын
what ya smoking? cause that's way off from actual answer @arjun singh correct ans buddy.
@sudheeksha1438
@sudheeksha1438 4 жыл бұрын
2 apples less than 3 bananas because of the length of the string
@ericosmostech4903
@ericosmostech4903 4 жыл бұрын
Not because of Length... Length Doesn't matter! decrease the size of 3 Bananas to 3 Ban! still same answer! cause, 3>2 only this part matters! Though answer was correct
@aravindkumar7150
@aravindkumar7150 2 жыл бұрын
2 apples less than 3 bannana
@chandramoulibhattacharya1144
@chandramoulibhattacharya1144 2 жыл бұрын
2 Apples is Less than 3 Bananas
@Kingdomprogrammer
@Kingdomprogrammer 2 жыл бұрын
2 apples are lesser than 3 Bananas
@bbom9197
@bbom9197 Жыл бұрын
2 Apples are lesser than 3 bananas
@Vikash-zq7vx
@Vikash-zq7vx Жыл бұрын
2 Apples are less than 3 Bananas.
@taruntej2286
@taruntej2286 Жыл бұрын
2 apples are smaller than 3 bananas
@Stekaren
@Stekaren 7 ай бұрын
I dont get it. int main(){ char *fruits[] = {"2 oranges", "2 Apples ", "3 bananas", "1 Pineapple"}; if(strcmp(fruits[1], fruits[2]) < 0 ){ printf("%s is lesser than %s", fruits[1], fruits[2]); } else if(strcmp(fruits[1], fruits[2]) > 0){ printf("%s are greater than %s", fruits[1], fruits[2]); } return 0; } /* so if string compare function, s1
@hrithikraj2326
@hrithikraj2326 Жыл бұрын
2 Apples are lesser than 3 Bananas.
@veerrajusingamsetti352
@veerrajusingamsetti352 4 жыл бұрын
2 Apples are greater than 2 Bananas
@zatchraj4506
@zatchraj4506 2 жыл бұрын
2 Apples are Less than 3 bananas
@ayushjangid
@ayushjangid 3 жыл бұрын
2 apples are less than 3 bananas
@raj8041
@raj8041 4 жыл бұрын
3 bananas are greater than 2apples
@Nielitian
@Nielitian 4 жыл бұрын
2 apples less than 3 bananas
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,2 МЛН
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
9:58
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 1,4 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
отомстил?
00:56
История одного вокалиста
Рет қаралды 5 МЛН
Declaring and Initializing String Variables
9:02
Neso Academy
Рет қаралды 193 М.
Recursion in C
11:12
Neso Academy
Рет қаралды 915 М.
Dynamically Allocate Memory For An Array Of Strings | C Programming Example
12:10
Java Tutorial - 14 - Arrays of Strings
12:16
Math and Science
Рет қаралды 116 М.
String Comparison Function - strcmp()
6:04
Neso Academy
Рет қаралды 134 М.
C_62 Strings in C - part 1 | C programming tutorials
15:41
Jenny's Lectures CS IT
Рет қаралды 489 М.
Reading Strings using scanf and gets Functions
5:19
Neso Academy
Рет қаралды 163 М.
Array of Strings in C++(Urdu/Hindi)
10:52
IT Series
Рет қаралды 12 М.