CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 Nothing great, you have to just add '&' symbol before the variable name you are passing to the function. That's it. by adding &, you are passing the location of the variable to the function instead of function. Search your text book for some examples why search?I'll ask my teacher to explain that to me again !! Quote
shivam94 Posted April 22, 2012 Report Posted April 22, 2012 why search?I'll ask my teacher to explain that to me again !! LOL Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 And as i said shivam waswrong about all operation in calculate function is going!!! shivan -1 Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 dafuck 10,000 lines? And what u test means what kinda programs ur company makes? All types of software from telecom software, retail software, banking software, medical software to pretty much anything you can think of. Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 why search?I'll ask my teacher to explain that to me again !! Whats there to ask your teacher? Its easy. In call by value you pass the values of the variables you are passing and they are stored in local variables in the function. So as soon as you exit the body of the function the local variables of the function gets destroyed and along with that the result of your calculation also gets destroyed. But if you call by reference then the address of the variable are passed to the function. So any alteration of the variables made in the function directly affects the passed variables. Its as simple as that. Quote
NiharG Posted April 22, 2012 Report Posted April 22, 2012 u meant this na? most probly u mant this i'm i wrong?or u meant same by case method i'm i wrong? (note:i didn't compiled the program) Yeah! I was thinking of a similar program. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 Yeah! I was thinking of a similar program.dude in that its can be used where its written only!! means in what i wrote where i want sum i'll simply write calculate() and whats in calculate will be executed simply!! its more easy for long page programs Quote
NiharG Posted April 22, 2012 Report Posted April 22, 2012 dude in that its can be used where its written only!! means in what i wrote where i want sum i'll simply write calculate() and whats in calculate will be executed simply!! its more easy for long page programs Okay! Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 @CrackUC I forgot to mention i saw 1more bad programming practice in your program. You should not use void main() as your main function. Instead use int main(). Although 99% of the compilers wont object to this but void main() is actually a non-standard implementation of main(). The C and C++ standard defines main to be of the following 2 forms-- i. int main() ii. int main(int arg c,char *argv) So its better to use main in the above mentioned two forms. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 @CrackUC I forgot to mention i saw 1more bad programming practice in your program. You should not use void main() as your main function. Instead use int main(). Although 99% of the compilers wont object to this but void main() is actually a non-standard implementation of main(). The C and C++ standard defines main to be of the following 2 forms-- i. int main() ii. int main(int arg c,char *argv) So its better to use main in the above mentioned two forms.Than i'l go with int main 1st one.!! I'm learning C as i don have talent in any thing in Pc the things i know are useless And if i go to any job they'll reject me as i know nothing though i'm in 10th but still it matters for me!! i'm learning C for idea of programming and i think i'll probly learn java too in home itself!! but i'll be going with VB after it my course is just 15 classes more after that i'll pratise badly in vacations After that VB what u say?Vb or any other? Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 Than i'l go with int main 1st one.!! I'm learning C as i don have talent in any thing in Pc the things i know are useless And if i go to any job they'll reject me as i know nothing though i'm in 10th but still it matters for me!! i'm learning C for idea of programming and i think i'll probly learn java too in home itself!! but i'll be going with VB after it my course is just 15 classes more after that i'll pratise badly in vacations After that VB what u say?Vb or any other? You're in class 10 only so dont think about jobs now. Just enjoy life while you can . And after you finish C you should definitely start C++. There are lots of new things in C++ that aren't in C. Once you master C++, learning java will be a piece of cake. After you learn java if you do want to learn any other language then i would suggest SQL & PL/SQL. SQL is easy. You can learn SQL in a single day. There is nothing to it. But PL/SQL is extremely difficult. It'll take a lot of time for you to learn it. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 You're in class 10 only so dont think about jobs now. Just enjoy life while you can . And after you finish C you should definitely start C++. There are lots of new things in C++ that aren't in C. Once you master C++, learning java will be a piece of cake. After you learn java if you do want to learn any other language then i would suggest SQL & PL/SQL. SQL is easy. You can learn SQL in a single day. There is nothing to it. But PL/SQL is extremely difficult. It'll take a lot of time for you to learn it.Dude as u know c is a lil kinda boor.(not always but most of times)As many things gets uncleared.Still i put my max effort to make them clear My eacher said VB would be interesting but still i'll go what u says as u r more expert than him too(i think). BTw why its said not to global variables? Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 And how about PHP asp.net?And difference b/w c++ and java?just syntax or any other too? And i'm learning languages as i'm weak in studies.Weak means i no devotes it time stil from 10th i study 1 hour daily as i want science in 11th. + languages would be a back support for me if i won't get addmition in good collage!! i don't want to strugle in life for money atleast.. Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 Dude as u know c is a lil kinda boor.(not always but most of times)As many things gets uncleared.Still i put my max effort to make them clear My eacher said VB would be interesting but still i'll go what u says as u r more expert than him too(i think). BTw why its said not to global variables? You think C is boring? Wait till you study database concepts. You'll fall asleep . I would not recommend VB to you because its not used in the industry much. And dont say C is difficult. If you think C is difficult then PL/SQL will make you go mad. Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 And how about PHP asp.net?And difference b/w c++ and java?just syntax or any other too? And i'm learning languages as i'm weak in studies.Weak means i no devotes it time stil from 10th i study 1 hour daily as i want science in 11th. + languages would be a back support for me if i won't get addmition in good collage!! i don't want to strugle in life for money atleast.. PHP and asp.net is good if you want to be a web designer. But there isn't much money in web designing. But if web designing is your hobby you can definitely learn HTML and PHP. They are very simple languages. It wont take long to learn them. But don't think about languages now and study hard. You can learn languages any time but study comes first. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 You think C is boring? Wait till you study database concepts. You'll fall asleep . I would not recommend VB to you because its not used in the industry much. And dont say C is difficult. If you think C is difficult then PL/SQL will make you go mad.Dude my file handling chapter is left by databases u meant same or other thing pl/sql is used in industries?And for what purposes? U r a comunication engineer i think..So hw come these languages came in ur job Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 BTw why its said not to global variables? It is recommended not to use global variables for data security purposes. If a variable is global then it can be accessed by any function in the program. So any unwanted function may accidentally change the value of your global variable by mistake. So it is recommended not to use global variables. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 It is recommended not to use global variables for data security purposes. If a variable is global then it can be accessed by any function in the program. So any unwanted function may accidentally change the value of your global variable by mistake. So it is recommended not to use global variables. than it will be a great loop whole for hackers Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 Dude my file handling chapter is left by databases u meant same or other thing pl/sql is used in industries?And for what purposes? U r a comunication engineer i think..So hw come these languages came in ur job No by database i meant a subject called DBMS(Database Management System). And yes pl/sql is extensively used in the industry. Its used to write programs for database management systems like oracle, MS SQL Server, MySQL Server etc. I handle telecom projects where you have to design software for telecom companies. You need software for many functions over there. Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 than it will be a great loop whole for hackers Not exactly but yes your program will be vulnerable. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 No by database i meant a subject called DBMS(Database Management System). And yes pl/sql is extensively used in the industry. Its used to write programs for database management systems like oracle, MS SQL Server, MySQL Server etc. I handle telecom projects where you have to design software for telecom companies. You need software for many functions over there.its in C?if yes i'll ask my teacher to teach me that too!! just confirm me its in C . Not exactly but yes your program will be vulnerable.Hmm.. suppose u r a hacker so hw u'll steal the data in programe xplain hw u'll hack into it?it will be more clear for me!! #include<stdio.h> #include<conio.h> char pin; void enter() { printf("enter your secret PIN"); scanf("%ch",pin); } int main() { printf("Your pin has been stored safely"); getch(); } Suppose u have hack the pin in character stored by user hw u'll do that? Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 its in C? No. DBMS is not a language. PL/SQL is the language. Suppose u have hack the pin in character stored by user hw u'll do that? It can be done by a technique called memory injection. Well in this particular case we dont have to inject anything into memory but we generally do require to do that. Anyways for memory injection you can use a software called Cheat Engine. Using Cheat Engine you can read the values of the variables of your program at run time. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 Lolz i just compiled that program that program stops responding after i enter pin here's the program anindya please point out the mistake! #include<stdio.h> #include<conio.h> int pin; int enter() { printf("enter your secret PIN:"); scanf("%d",pin); } int display() { printf("Your pin has been stored safely"); } int main() { enter(); display(); getch(); } Quote
Anindya1989 Posted April 22, 2012 Report Posted April 22, 2012 Lolz i just compiled that program that program stops responding after i enter pin here's the program anindya please point out the mistake! You forgot to give ampersand before pin in scanf. Quote
CrackUC Posted April 22, 2012 Author Report Posted April 22, 2012 You forgot to give ampersand before pin in scanf. dafuq again hw i forgot those basics while writing sorry !! 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.