Anindya1989 Posted April 26, 2012 Report Posted April 26, 2012 lol why, i sometimes use them to get out of tight spots I already explained why in my previous posts. Here read this-- No there aren't any bugs but it gives rise to a lot of problems later on. After a software is made it has to maintained and enhanced. Bugs have to removed, improvements and new features have to be to be added and the software has to be tweaked from time to time as per the clients changing business needs. So after a software is developed it has to be maintained by a separate group of people. Since goto is an unconditional program branching the maintenance guy reading your code might not understand why you have used it in your program. So in any software development company the goto statement is banned. Only conditional branching is allowed. Quote
anurag Posted April 26, 2012 Report Posted April 26, 2012 I already explained why in my previous posts. Here read this-- and i always wondered why teachers didnt like it,because they never explained Quote
CrackUC Posted April 27, 2012 Report Posted April 27, 2012 USING GOTO STATEMENTS IS PUNISHABLE BY DEATH!! Using goto statements is an offence that can get you fired from any software development company.y goto is punishable?we can write comments why we used can't we? Quote
NiharG Posted April 27, 2012 Author Report Posted April 27, 2012 y goto is punishable?we can write comments why we used can't we? He has already explained that. Read the whole thread. Quote
Anindya1989 Posted April 27, 2012 Report Posted April 27, 2012 y goto is punishable?we can write comments why we used can't we? Well its banned in all respectable software development companies i know of. The GOTO statement is a very poor shortcut. You use GOTO statement only when you can't think of any other logical way to write your program. Using the GOTO statement is in essence an act of desperation. So good programming practice forbids you from using it. Quote
CrackUC Posted April 27, 2012 Report Posted April 27, 2012 Well its banned in all respectable software development companies i know of. The GOTO statement is a very poor shortcut. You use GOTO statement only when you can't think of any other logical way to write your program. Using the GOTO statement is in essence an act of desperation. So good programming practice forbids you from using it. So instead of goto u make different functions And return them? Update: Putting && also does the job. it will do '&&' means that like if u have 5 condtions than all must be true than only if part would be executed And '||' means that if one of any 5 conditions is true than it will executed And '!=' means that should not be equal to that than only condition will become true And if part will be executed ..And '==' means that is equal to And '=' means you are addressing it!! Hope u were knowing all these!! Quote
Anindya1989 Posted April 27, 2012 Report Posted April 27, 2012 So instead of goto u make different functions And return them? You can do that or you can also use while loops and do-while loops. Quote
CrackUC Posted April 27, 2012 Report Posted April 27, 2012 You can do that or you can also use while loops and do-while loops.while And do-while will be dificult for me!! i'll do that only!! Quote
Anindya1989 Posted April 27, 2012 Report Posted April 27, 2012 while And do-while will be dificult for me!! i'll do that only!! But in some cases you will need to use a while loops. Use functions for now. When you become confident in loops you can start using while loops. Its pretty easy really and is less resource hungry and doesn't involve the function call overheads. Quote
CrackUC Posted April 27, 2012 Report Posted April 27, 2012 But in some cases you will need to use a while loops. Use functions for now. When you become confident in loops you can start using while loops. Its pretty easy really and is less resource hungry and doesn't involve the function call overheads.less resource hundry I don think any of my c program will every took more than 2 mb ram too!! Quote
Anindya1989 Posted April 27, 2012 Report Posted April 27, 2012 less resource hundry I don think any of my c program will every took more than 2 mb ram too!! You have to think about the time when your functions will be hundreds of lines long. Quote
CrackUC Posted April 27, 2012 Report Posted April 27, 2012 You have to think about the time when your functions will be hundreds of lines long.dude i wanna know a thing i didn't remember exact example to explain that to u but like When there are users to search their roll no. And we need to build a search program for that.than that process would be very lengthy to compare every string with user requested And it will take hours if thr were millions of strings present so can't we make every string store in the same memory address? like roll no. 4567 will be stored in memory adress 4567 if we made that possible than searching would be of seconds as just we have to jump to that adress we searched for!! Quote
anurag Posted April 27, 2012 Report Posted April 27, 2012 dude i wanna know a thing i didn't remember exact example to explain that to u but like When there are users to search their roll no. And we need to build a search program for that.than that process would be very lengthy to compare every string with user requested And it will take hours if thr were millions of strings present so can't we make every string store in the same memory address? like roll no. 4567 will be stored in memory adress 4567 if we made that possible than searching would be of seconds as just we have to jump to that adress we searched for!! for getting fast searching there are many algorithms like binary search Quote
Anindya1989 Posted April 27, 2012 Report Posted April 27, 2012 dude i wanna know a thing i didn't remember exact example to explain that to u but like When there are users to search their roll no. And we need to build a search program for that.than that process would be very lengthy to compare every string with user requested And it will take hours if thr were millions of strings present so can't we make every string store in the same memory address? like roll no. 4567 will be stored in memory adress 4567 if we made that possible than searching would be of seconds as just we have to jump to that adress we searched for!! No its not possible to do that. You cannot store variables in memory addresses equal to their values. To search something in a large amount of data we can sort the data and use binary search instead of linear search which results in extremely fast searching time. But sorting the data isn't really possible all the time in real life. Suppose you have 100 million strings and you need to find one particular string among them. In that situation it is not practically possible to sort 100 million alpha-numeric strings. So in such situations we employ a method known as indexing. If your database is indexed properly it takes only a few seconds to find any data amongst even 100 million data members. Quote
NiharG Posted April 29, 2012 Author Report Posted April 29, 2012 it will do '&&' means that like if u have 5 condtions than all must be true than only if part would be executed And '||' means that if one of any 5 conditions is true than it will executed And '!=' means that should not be equal to that than only condition will become true And if part will be executed ..And '==' means that is equal to And '=' means you are addressing it!! Hope u were knowing all these!! I know all these. Thats why I can make a program Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.