Great Lectures.One of the best Educational Channels ever.Thanks a lot to team Neso Academy.
@ashishpradhan65034 жыл бұрын
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.
@ericosmostech49034 жыл бұрын
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!
@ashishpradhan65034 жыл бұрын
@@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..
@ericosmostech49034 жыл бұрын
@@ashishpradhan6503 Yes... You're right, if your thinking that way! :D
@aravindks76364 жыл бұрын
@@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
@ericosmostech49034 жыл бұрын
@@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?
@prateekdubey70764 жыл бұрын
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
@shvideo12 жыл бұрын
Excellent tutorial. Very useful and to-the-point. Thank you for sharing.
@ranjanverma65884 жыл бұрын
2 Apples are lesser than 3 Bananas.........Thank you, sir, for such a wonderful lecture. Please upload File handling videos.
@taradevi81303 жыл бұрын
It will display the statement....2 Apples are lesser than 3 Bananas
@shivanshuchauhan60264 жыл бұрын
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_00285 жыл бұрын
Please upload data structures also . Asap sir
@mukulsharma84844 жыл бұрын
They are not listening dude
@sameerkaushik5374 жыл бұрын
Please upload the data structure video
@ericosmostech49034 жыл бұрын
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 !
@forgetfulfunctor12 жыл бұрын
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 Жыл бұрын
Interesting work! There I would use them according to the use case.
@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 Жыл бұрын
@@cuteonigiri1671 yeah
@mohamed_abdelrahman10 Жыл бұрын
you are right
@diversiontv77711 ай бұрын
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
@abdulrubbinmohsin61114 жыл бұрын
awesome lecture . sir kindly upload DATA STRUCTURE Lectures ASAP.
@staceyloulouse3 жыл бұрын
how do i assign the values of the string array during runtime (as input from user)?
@cemilbayhan14344 жыл бұрын
Has your channel a video explaining the functions(malloc,calloc etc.)? Also thanks for this video. Thanks @Neso Academy
@nbk3304 жыл бұрын
watch videos in this playlist.. u will get it.. do some exercise.. n u will find it easily...
@cemilbayhan14344 жыл бұрын
@@nbk330 thanks a lot for reply :)
@vaishalivibestream5 жыл бұрын
Thank you sir.... Very well explained..
@shambhavisrivastava23402 жыл бұрын
Best channel on yt to learn coding. Hnds down 🙌🏼
@royalgamer1743 жыл бұрын
learned a lot from your channel.
@letsbethechange4814 жыл бұрын
If part evaluated S1 is lesser than s2 ASCII DIFFERENCE B/W--->> A and B
@yahyashaikh84392 жыл бұрын
Thank you so much sir my all doubt has been cleared in a very simple way God bless you your teaching way is perfect
@kunalsoni76815 жыл бұрын
sir this one is awesome presentation😘❤😗😙
@Memorable_days90s3 жыл бұрын
Else part will execute because O is greater than A based on ASCII codes
@kokilavanil37754 жыл бұрын
f[0]=2 oranges f[1]=2 apples f[2]=3 bananas f[3]=1 pineapple If ( strcmp(f[1],f[2])
@daughter_of_chitkute06119 ай бұрын
2 and 3 is a character here so won't it be considered for the evaluation?
@examtechsolution26093 жыл бұрын
How we can input by user input
@msmanviyogi51913 жыл бұрын
2 apples are lesser then 3 bananas. Thank you so much sir for wonderful Explanation .
@ajmalkhaniit4 жыл бұрын
Amazing tutorial!
@Bulbul_28203 жыл бұрын
Excellent lecture 🙂🙂keep it up
@saiajaygelli23803 жыл бұрын
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😅
@satyad52852 жыл бұрын
2 ORANGES ARE GREATER THAN 2 APPLES
@roshanmhatre88104 жыл бұрын
When are stacks, queues and other data structures uploaded? Nice Course BTW
@aritrasarkar15575 жыл бұрын
Please do course on computer science networking
@arunkumara38445 жыл бұрын
It will be very useful
@yacinealiouane88595 жыл бұрын
Thank u ser you helped me a lot ....please put more exercises 😍
@abishekbabu92474 жыл бұрын
@@nesoacademy sir where is the practice sheet
@dharu_223 жыл бұрын
fruits[1]2
@akashpraveen98143 жыл бұрын
Post a video about size of pointers and size of various pointers..
@ayushimalviya67194 жыл бұрын
Thanks sir... one of the best tutorial... Explanation is very clear...
@upendrakumarjha92453 жыл бұрын
Awesome way to teach.
@venkateshroyal74943 жыл бұрын
fruits[1]
@GauravSharma-ev3mb3 жыл бұрын
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___3 жыл бұрын
awesome lecture and now I also crave some fruits.
@mdrehan493 Жыл бұрын
It print the if condition
@MartinPHE5 жыл бұрын
great stuff
@sairam_world2 жыл бұрын
Nice
@alfredchilini55185 жыл бұрын
keep going u r the best
@tails_the_god2 жыл бұрын
Thanks neso academy!
@darkspin48484 жыл бұрын
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
@shakthisri84093 жыл бұрын
#include int main() { int i,j=0,k; char fruits[2][100]; printf("number and fruit name: "); for(i=0;i
@shakthisri84093 жыл бұрын
But only single line is printed
@darkspin48483 жыл бұрын
@@shakthisri8409 thank you!
@shakthisri84093 жыл бұрын
@@darkspin4848 can u find the mistake in tat 🥺... it's printing only one line
@darkspin48483 жыл бұрын
@@shakthisri8409 I will get back to you as soon as I found an answer!!
@Animeshkumar2064 жыл бұрын
What does pointer to the first character mean ?
@kavayashrisheelavant29134 жыл бұрын
Address of the first character of a string..
@rz13593 жыл бұрын
Thanks, informative
@InfinityYo2 жыл бұрын
Sir suppose you want to take input as string using gets() in array of pointer then how it can be done?
@mohammedshaikh83432 жыл бұрын
thanks
@huycopper75342 жыл бұрын
thank you so much, this video is really useful
@hemanthkumargundumilli5 жыл бұрын
2 Apples are lesser than 3 Bananas
@vishallondhe72984 жыл бұрын
@@psarvani6994 do me a favour and study one dimensional arrays first, you will get why there are 2 apples and 3 bananas
@Victor-ti4fx4 жыл бұрын
@@vishallondhe7298 he just telling the answer why are you being a boomer?
@sahanasharon4294 Жыл бұрын
What is d use of arrays of strings ?
@smritipragya86334 жыл бұрын
@neso academy plz give us the solution of homework problem
@abhishekkumarsandliya78054 жыл бұрын
You may write the code in any online compiler and get your answer👍🏻
@JojoJojo-nt2pw Жыл бұрын
while declaration if we write "char** strs" what will it notify
@abhishekshetty89624 жыл бұрын
when does the difference in length of two string cause a difference
@rking27883 жыл бұрын
How to take input using scanf?
@shashankmishra53295 жыл бұрын
sir please upload ds soon.
@akshatk16902 жыл бұрын
ans:- lesser than fruit[2]
@aniketsahi1282 жыл бұрын
else part will appears on the output screen.
@makwanaronik45873 жыл бұрын
Sir please upload the file handing video ..
@nesoacademy3 жыл бұрын
kzbin.info/www/bejne/bpWVcmisotFsi7c
@smritipragya86334 жыл бұрын
Plz make a separate vedio lecture on homework problem
@true41893 жыл бұрын
Thank u
@adityasaxena66194 жыл бұрын
char *fruits[]={"2 Oranges","2 Apples","3 Bananas","1 Pineapple"}; printf("%d",sizeof(fruits)); please explain what and why will be the answer.
@vasireddyganesh4 жыл бұрын
I think it would return size of 4 char pointers... But iam not sure of it.. Plz let me know if iam wrong..
@mayursb22594 жыл бұрын
32
@PLATONU4 жыл бұрын
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 *
@ichaa3tech4 жыл бұрын
The playlist title is C programming not c++ programming.
@sahil85653 жыл бұрын
but what if we want to input the strings ?
@vaibhavsharma92982 жыл бұрын
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 )
@ingenierocristian2 жыл бұрын
Please, tell me you have a channel on Odysee!!
@theragarlanagamani4317 Жыл бұрын
Fruit 2 is great than fruit 1
@yagneshacharya24612 жыл бұрын
WHY WE DOESN'T USE 1D ARRAY WITHOUT POINTERS ?
@vaibhavsharma92982 жыл бұрын
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
@yagneshacharya24612 жыл бұрын
@@vaibhavsharma9298 thanks for info
@EngRiadAlmadani5 жыл бұрын
wow
@the_ocean_eyes2 жыл бұрын
Fruits [1] are lesser than fruits[2]
@newsdaily51863 жыл бұрын
what if this to be done in CPP pls some body help me?
@manasaravula27443 жыл бұрын
Pls tell me any one
@xboxlox3 жыл бұрын
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 ✳??
@bhoomikabhoomi29893 жыл бұрын
2>0 output
@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 Жыл бұрын
Abeee lodu🎉🎉
@karmakaraayon4238 Жыл бұрын
output: 2 Apples are lesser than 3 Bananas
@indiancoder83014 жыл бұрын
If gets evaluated
@bachinaganesh18913 жыл бұрын
First if block executed..... 😱😱😱😱
@bhoomikabhoomi29893 жыл бұрын
2,3
@matrixxhunt74014 жыл бұрын
2 oranges are greater than 2 Apples
@manasaravula27443 жыл бұрын
Array of strings and string arrays are same are not
@ayashakumarimandal86812 жыл бұрын
Homework: 2 Apples r lesser than 3 Bananas
@abhisheksinghmehra95762 жыл бұрын
2 apples are lesser than 3 bananas ==>answer
@nirbhayparmar4 жыл бұрын
2 apples are less than 3 banan
@adnansarkar92192 жыл бұрын
2 apples are lesser than 3 bananas
@rakshitrk78933 жыл бұрын
2 apples are lesser than 3 banana
@moeintaherkhani7289 Жыл бұрын
Answer to HW: 2 Apples are less than 3 Bananas
@sumanasriudumula68175 жыл бұрын
Is the answer 2 Apples are greater than 3 Bananas
@ArjunDev175 жыл бұрын
No, 2 Apples are lesser than 3 Bananas
@vishallondhe72984 жыл бұрын
what ya smoking? cause that's way off from actual answer @arjun singh correct ans buddy.
@sudheeksha14384 жыл бұрын
2 apples less than 3 bananas because of the length of the string
@ericosmostech49034 жыл бұрын
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
@aravindkumar71502 жыл бұрын
2 apples less than 3 bannana
@chandramoulibhattacharya11442 жыл бұрын
2 Apples is Less than 3 Bananas
@Kingdomprogrammer2 жыл бұрын
2 apples are lesser than 3 Bananas
@bbom9197 Жыл бұрын
2 Apples are lesser than 3 bananas
@Vikash-zq7vx Жыл бұрын
2 Apples are less than 3 Bananas.
@taruntej2286 Жыл бұрын
2 apples are smaller than 3 bananas
@Stekaren7 ай бұрын
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