Signup as a Tutor

As a tutor you can connect with more than a million students and grow your network.

BSc Tuition

BSc Computer Science

Trending Questions and Lessons

Follow 24,171 Followers

Ask a Question

Feed

All

All

Lessons

Discussion

Lesson Posted on 23/12/2017 Tuition/BSc Tuition/BSc Computer Science

C++: Passing A Function As an Argument

Ashutosh Singh

I can teach each and every topics very easily and make it stronger for the students.

#include using namespace std; int sum(int a,int b) { return a+b; } void f2(int (*f)(int,int),int a,int b) //'*f' is a POINTER TO A FUNCTION whose RETURN TYPE is //'int' and arg type (int,int) . Here, '*f' is FORMAL PARAMETER { ... read more

#include
using namespace std;

int sum(int a,int b)
{
   return a+b;
}
void f2(int (*f)(int,int),int a,int b) //'*f' is a POINTER TO A FUNCTION whose RETURN TYPE is                                                           //'int' and arg type (int,int)  . Here, '*f' is FORMAL PARAMETER
{                                                                
  cout<<sum(a,b)<<endl;
}
int main()
{   int (*p1)(int,int)=∑          //Here, '*pf1' is ACTUAL PARAMETER
    f2(sum,10,20);                         //NAME OF A FUNCTION IS ITSELF A POINTER TO ITSELF
    f2(p1,20,79);
    return 0;

}

read less
Comments
Dislike Bookmark

Lesson Posted on 05/07/2017 Tuition/BTech Tuition/BTech Computer Science Engineering Tuition/BTech Tuition/BTech Information Science Engineering Tuition/BCA Tuition +1 Tuition/BSc Tuition/BSc Computer Science less

What Are Register Variables?

Shiladitya Munshi

Well, I love spending time with students and to transfer whatever computing knowledge I have acquired...

Registers are faster than memories to access. Hence when we declare a variable with a registerkey word, the compiler gets to know that the variable can be put to registers. Now whether the variables will be put into the register indeed or not, that depends on the compiler and the number and size of the... read more

Registers are faster than memories to access. Hence when we declare a variable with a registerkey word, the compiler gets to know that the variable can be put to registers. Now whether the variables will be put into the register indeed or not, that depends on the compiler and the number and size of the registers for the corresponding hardware.

In general, the variables which are to be used with high frequencies (like loop variables) are the perfect choice for declaring as register, because the gain in speed would be considerable in those cases.

It is not allowed to access the address of the register variables as accessing the address of the register is illegal.

It is perfectly all right to declare a pointer as register because a register can always store the address of other variables if the size of the register permits that to do.

read less
Comments
Dislike Bookmark

Lesson Posted on 05/07/2017 Tuition/BTech Tuition/BTech Computer Science Engineering Tuition/BTech Tuition/BTech Information Science Engineering Tuition/BCA Tuition +1 Tuition/BSc Tuition/BSc Computer Science less

What Is The Difference Between Scope And Lifetime?

Shiladitya Munshi

Well, I love spending time with students and to transfer whatever computing knowledge I have acquired...

Scope of a variable is defined as the block of code from where we can refer or access it. On the other hand the life time of a variable is defined as the time in between allocating memory for it and relinquishing the memory from it. Let us have an example void func1(void){ int x = 5; // do other stuffs } void... read more

Scope of a variable is defined as the block of code from where we can refer or access it. On the other hand the life time of a variable is defined as the time in between allocating memory for it and relinquishing the memory from it. Let us have an example

void func1(void){

int x = 5;

// do other stuffs

}

void func2(void){

int y = 10;

func1();

//do other stuffs

}

In the above example scope of x is func1 and scope of y is func2. Now when we call func1from func2, then inside func, scope of y is ended but the life time of y still persists, because the memory for y is still not relinquished.

read less
Comments
Dislike Bookmark

Looking for BSc Tuition

Find best BSc Tuition in your locality on UrbanPro.

FIND NOW

Lesson Posted on 05/07/2017 Tuition/BTech Tuition/BTech Computer Science Engineering Tuition/BTech Tuition/BTech Information Science Engineering Tuition/BCA Tuition +1 Tuition/BSc Tuition/BSc Computer Science less

Some Interview Questions And Answers For Fresher Level On Pointers

Shiladitya Munshi

Well, I love spending time with students and to transfer whatever computing knowledge I have acquired...

What is a void pointer? Void pointer is a special type of pointer which can reference or point to any data type. This is why it is also called as Generic Pointer. As a void pointer can point to any data type, neither it is possible to dereference a void pointer, nor is it possible to do any arithmetic... read more

What is a void pointer?

Void pointer is a special type of pointer which can reference or point to any data type.  This is why it is also called as Generic Pointer.

As a void pointer can point to any data type, neither it is possible to dereference a void pointer, nor is it possible to do any arithmetic operations on void pointer. Hence an explicit type casting is absolutely must for using a void pointer.

What is a null pointer?

A null pointer is also a special type of pointer which points definitively to nothing.

As per official C language description, every valid type of pointer has a special value called “Null Pointer” and this value is always distinguishable from all other pointer values and it is guaranteed to compare unequal to a pointer of any object or function.  

Hold it for a second! So what you are saying is there are different versions of null pointers for every pointer type. Is it so?

No. We cannot call it as a “different versions” rather their internal values are different. But as a programmer, we need not to worry about it because compilers take care of and track the internal values (may be differently depending on the compiler types)

So why don’t you say that a null pointer is a pointer which is not initialized yet?

I cannot go with this idea because an uninitialized pointer may point to any thing. There might be an uninitialized char pointer, an uninitialized int pointer and so on. But a null pointer is definitely something which is there not to point anything.

Ok. Now tell me what is a dangling pointer?

Dangling pointers are the pointers which point to already de allocated or de referenced memory locations. Suppose I write a piece of code like this

int*p;

p = (int*)malloc(n*sizeof(int);

----

----

free(p);

In this piece of code, after allocating some memory to p, we are de allocating the memory which was initially pointed by p. Hence now onwards, p acts as dangling pointer.

How to rectify this?

In this case, after de allocation that is after using free() we should set the pointer p to null as p = NULL   

Could you please exhibit any other source of dangling pointer problems?

Well, there might be other sources also, like

Suppose I have declared int*p, and within a specific scope, I have defined another integer x as 10; and then within that specific scope I am making the pointer p to hold the base address of x. Now outside this specific scope the p will act as a dangling pointer. I can write the code as

void foo (void)

{

   int *p;

   {

          {

int x = 10;

                 p = &x;

          }

          // here p will act as dangling pointer

   }

}

Another case might occur when from a function, we return an address of any variable and a corresponding pointer in the receiver section receives it, then the receiving pointer might get into dangling pointer problem, as just after the returning, as the variable has passed it scope, the memory stack (where the variable is stored currently) might be refreshed. But this phenomenon is not obvious, this might happen.

Fine, so how to deal with this second case?

To deal with this, to be in safer side, we must have the scope of the variable intact out of the function call; declaring it as static might be an option.

read less
Comments
Dislike Bookmark

Lesson Posted on 05/07/2017 Tuition/BTech Tuition/BTech Computer Science Engineering Tuition/BTech Tuition/BTech Information Science Engineering Tuition/BCA Tuition +1 Tuition/BSc Tuition/BSc Computer Science less

Pointers And References

Shiladitya Munshi

Well, I love spending time with students and to transfer whatever computing knowledge I have acquired...

Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference both hold the address of other variables. Up to this they look similar, but their syntax and further consequences... read more

Are reference and pointers same?

No.

I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning.

Pointers and reference both hold the address of other variables. Up to this they look similar, but their syntax and further consequences are totally different. Just consider the following pieces of code

Code 1                                         Code 2

int i;                                             int i;

int *p = &i;                                 int &r = i ;

Here in code 1 we have declared and defined one integer pointer p which points to variable i, that is now , p holds the address of i.

In code 2, we have declared and defined one integer reference r which points to variable i, that is now, r holds the address of i. This is completely same as that of p.

So where is the difference?

The first difference can be found just by looking at the code. Their syntaxes!

 Secondly the difference will come up when they would be used differently to assign a value (suppose 10) to i.

 If you are using a pointer, you can do it like *p = 10; but if you are using a reference, you can do it like r = 10.  Just be careful to understand that when you are using pointers, the address must be dereferenced using the *, whereas, when you are using references, the address is dereferenced without using any operators at all.

 This notion leaves a huge effect as consequences. As the address of the variable is dereferenced by * operator, while using a pointer, you are free to do any arithmetic operations on it. That is you can increment the pointer p to point to the next address just by doing p++. But, this is not possible using references.  So a pointer can point to many different elements during its lifetime; where as a reference can refer to only one element during its life time.

Does C language support references?

No. The concept of reference has been added to C++, not in C. So if you run the following code, C compiler will object then and there.

 #include

#include

int main(void)

{

    int i;

    int &r = i;

    r = 10;

    printf("\n Value of i assigned with reference r = %d",i);

    getch();

    return 0;

}

 But if you are using any C++ compiler, this code will work fine as expected.

 If there is no concept of reference in C language, then how come there exists C function call by reference?

Strictly speaking, there is no concept of function call by reference in C language. C only supports function call by value. Though in some books ( I will not name any one) it is written that C supports function call by reference or the simulation of  function call by reference can be achieved through pointers, I will strongly say that C language neither directly supports function call by reference, nor provides any other mechanism to simulate the same effect.

I know you are at your toes to argue that what about calling a C function with address of a variable and receiving it with a pointer? The change made to that variable within the function has a global effect. How this cannot be treated as an example of function call by reference?

You probably argue with a code like following

 #include

#include

void foo(int* p)

{

     *p = 5;

      printf("\n Inside foo() the value of the variable: %d",*p);

}

int main(void)

{

    int i = 10;

    printf("\n before calling  foo() the value of the variable: %d",i);

    foo(&i);

    printf("\n after calling  foo() the value of the variable: %d",i);

    getch();

    return 0;

}      

  Your code will show the result as 

Your points are well taken. But the thing is what you are showing is not at all calling a function by reference. It just the function call by value! Here you are essentially copying the value of address of your variable i and calling the function foo with that copy. Now eventually in this case, the value that is being passed contains the address of another variable. Within the function, you are accepting this value with a pointer and changing the value of the content addressed by that pointer. So it is nothing but a function call by value only.

 Please note that to change the value of the content addressed by a pointer, you are to use *, no way could it be thought of as a reference.

 Now let me give you one example of true function call by reference

 #include

#include

void foo (int& r1)

{

     r1 = 5;

     printf("\n Inside foo() the value of the variable: %d", r1);

}

int main(void)

{

    int i = 10;

    int &r = i;

    printf("\n before calling  foo() the value of the variable: %d",i);

    foo(r);

    printf("\n after calling  foo() the value of the variable: %d",i);

    getch();

    return 0;

}

 Will this run with your C compiler? No.

 Note:: I have used DevC++ as the coding platform

 

read less
Comments
Dislike Bookmark

Lesson Posted on 07/06/2017 Tuition/BCA Tuition IT Courses/Computer Course Tuition/BSc Tuition +3 Tuition/BSc Tuition/BSc Computer Science Tuition/BSc Tuition/Information Security Tuition/BSc Tuition/Internet Technologies less

Malware

Mohamed Badar Bawni

4 year of teaching experience my number is nine eight two one seven eight six nine six nine have been...

Malware Vivek like any other teenage boy loves to play online games on his phone. He usually downloads the free games available at the trusted market zones. One day, he got an SMS “Click here to get the Latest Paid Games Online for free“. Excitedly, he clicked on the link and downloaded... read more
Malware
 
Vivek like any other teenage boy loves to play online games on his phone. He usually downloads the free games available at the trusted market zones.
 
One day, he got an SMS “Click here to get the Latest Paid Games Online for free“. 



Excitedly, he clicked on the link and downloaded and installed the game. Unknowingly to him, these 
games had a malicious part that allowed the attacker to take control of his phone and made it unusable. 

This was a “Drive-by Download“ attack and due to his oversight, Vivek’s phone was infected with a Malware. 

New Android malware can infect your phone by simply visiting a website Andrord “malware HummingBad infects 10 million phones

Malwares can be a Virus, Worm or Troian horse that can come to you through use of un-licensed software, unknowingly downloading free but untrusted software programs, or through the use of infected pen drives, storage cards etc 

How to be safe? 

1) Never click unfamiliar links or download unfamiliar content. 

2) Keep your computer system updated with a good anti-virus software 

3) ignore any mails or invites which comes from unknown sources. 

4) Always scan the shared drives before using it.


 

read less
Comments
Dislike Bookmark

Looking for BSc Tuition

Find best BSc Tuition in your locality on UrbanPro.

FIND NOW

Lesson Posted on 14/05/2017 IT Courses/Internet Security Tuition/BSc Tuition Tuition/BSc Tuition/BSc Computer Science

Phishing

Mohamed Badar Bawni

4 year of teaching experience my number is nine eight two one seven eight six nine six nine have been...

Phishing: Sam received an email “Congratulations. . .You have won a Lottery!!!” Now, wasn’t that tempting..l The message said:[Dear Winner, kindly ‘view your Lottery] It meant that he has won the lottery. ‘ The message said that he must Immediately reply to the lottery... read more

Phishing:

Sam received an email “Congratulations. . .You have won a Lottery!!!” Now, wasn’t that tempting..l

The message said:[Dear Winner, kindly ‘view your Lottery]

It meant that he has won the lottery.

‘ The message said that  he must Immediately

reply to the lottery official to claim the lottery  amount.

In his excitement, Ram shared all the required personal information, including his  bank account Number, IFSC Code, telephone number, and all the other details that were
asked in the email. It was only later that he realized that this was a scam message which could use this personal information in an unethical way.

The fraudsters obviously attempted to make the email appear genuine and convince him!

Phishing attacks are sent via email and ask users to click on a link which redirects to a dummy site where an attacker wants victim to enter their personal data or respond to an email which will steal all your personal information. In some cases, a user has to just click on the link.

What should you do?

Follow some simple rules:

1)Remember, you cannot win a lottery you have not participated in.

2) Do not trust random messages or those containing obvious mistakes.

3) Always check the sender’s email address. Lottery organizers will not send messages from free mail services.

If you still think it is a real win, check all the information. Use search engines to look at the lottery, senders’ names and telephone numbers.

4) If you have shared financial details, call the bank or the credit card company immediately to stop or deactivate any payments.

read less
Comments
Dislike Bookmark

Answered on 07/02/2017 Tuition/BSc Tuition Tuition/BSc Tuition/BSc Computer Science

Shashank Maheshwari

Microsoft Certified Turor

These days, front-end development refers to the part of the web users interact with. In the past, web development consisted of people who worked with Photoshop and those who could code HTML and CSS. Now, developers need a handle of programs like Photoshop and be able to code not only in HTML and CSS,... read more
These days, front-end development refers to the part of the web users interact with. In the past, web development consisted of people who worked with Photoshop and those who could code HTML and CSS. Now, developers need a handle of programs like Photoshop and be able to code not only in HTML and CSS, but also JavaScript or jQuery, which is a compiled library of JavaScript. Most of everything you see on any website is a mixture of HTML, CSS, and JavaScript, which are all controlled by the browser. For example, if you are using Google Chrome or Firefox, the browser is what translates all of the code in a manner for you to see and with which to interact, such as fonts, colors, drop-down menus, sliders, forms, etc. In order for all of this to work, though, there has to be something to support the front-end; this is where the backend comes into play. read less
Answers 10 Comments
Dislike Bookmark

Lesson Posted on 10/01/2017 Functional Training/Internet & Digital Media/Digital Marketing Training Tuition/BTech Tuition Tuition/BCA Tuition +8 Tuition/BCA Tuition/Software Engineering Life Skills Coaching/Soft Skills Training Life Skills Coaching/Soft Skills Training/Business English Tuition/BBA Tuition Tuition/BBA Tuition/Computer Applications in Business Tuition/BSc Tuition Tuition/BSc Tuition/BSc Computer Science Tuition/BTech Tuition/Computer science less

How to Become a Self Made Digital Marketing Expert?

Geek M.

I am very experienced on all above mentioned skills. I am very friendly in nature.

Applying Digital Marketing on a Small Scale Choose a topic you are passionate about and start a blog about it. Cost: Approx $50 per year for domain and hosting. Learn a little about SEO and write SEO optimized articles in your blog. Install Google Analytics tracking code and see if you are getting... read more

Applying Digital Marketing on a Small Scale

  • Choose a topic you are passionate about and start a blog about it. Cost: Approx $50 per year for domain and hosting.
  • Learn a little about SEO and write SEO optimized articles in your blog.
  • Install Google Analytics tracking code and see if you are getting some traffic to your blog. Explore Google Analytics.
  • Open an Adwords account and do some keyword research to see what people are searching for in Google to find information on the topic you are blogging about.
  • Write more articles and publish on your blog.
  • Open a Facebook page dedicated to your blog (apart from your personal page) and share the articles on your Facebook page.
  • Promote your page with Facebook advertising. Budget for promotion can be as low as $10.
  • Implement Facebook like box in your blog.
  • Embed social sharing buttons in your blog articles. You can do this using WordPress plugins and it is free.
  • Sign up for an email marketing service such as Aweber. Costs $20 per month. Also try MailChimp.
  • Embed email signup forms in your blog and collect subscribers. Email subscribers whenever you publish something in your blog.
  • Promote your Facebook page through email marketing and in turn also get more email subscribers from your Facebook page.
  • Promote your blog via Adwords. Get started with very low CPC bids. Most new Adwords accounts get a free $100 credit for promotion. If you don’t get it, call Adwords support and they will give you free credits to get you started.
  • Sign up for Google Adsense and deploy advertising codes in your blog.
  • Convert your blog into a mobile friendly blog and create mobile ads in Adwords.

All the above steps can be done in 30 days by investing one hour per day. After you do all the steps above your would have gained a bit of hands-on experience in the following areas which pretty much sums up to the following major components of Digital Marketing:

read less
Comments
Dislike Bookmark

Looking for BSc Tuition

Find best BSc Tuition in your locality on UrbanPro.

FIND NOW

Lesson Posted on 10/01/2017 Tuition/BTech Tuition Functional Training/Internet & Digital Media/Digital Marketing Training IT Courses/Programming Languages/PHP +9 IT Courses/Programming Languages/PHP /PHP Realtime Project Tuition/BSc Tuition Tuition/BCA Tuition Tuition/BCA Tuition/E-Commerce Tuition/BCA Tuition/Software Engineering Tuition/BSc Tuition/BSc Computer Science Tuition/BA Tuition Tuition/BA Tuition/Business Communication Tuition/BSc Tuition/Technical Writing & Communication in English less

Components of Digital Marketing

Geek M.

I am very experienced on all above mentioned skills. I am very friendly in nature.

Content marketing Search Engine Optimization (SEO) Paid Search (PPC) Email marketing Social Media Marketing Digital Display Marketing (Ad Ops) Web Analytics and Reporting Mobile Marketing 30 hours of experience does not make you an expert in Digital Marketing but you will be a much better... read more
  • Content marketing
  • Search Engine Optimization (SEO)
  • Paid Search (PPC)
  • Email marketing
  • Social Media Marketing
  • Digital Display Marketing (Ad Ops)
  • Web Analytics and Reporting
  • Mobile Marketing

30 hours of experience does not make you an expert in Digital Marketing but you will be a much better qualified digital marketing professional than most of the people out there on the market. After this you can continue scaling up your mini-project and add even more things to it. For example, Google webmaster tools integration is something I have not mentioned in the above list but it is important for digital marketing. Your expertise will increase to the level you are ready to scale up your project.

read less
Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best BSc Tuition in India. Post Your Requirement today and get connected.

Overview

Lessons 29

Total Shares  

Related Topics

Top Contributors

Connect with Expert Tutors & Institutes for BSc Computer Science

x

Ask a Question

Please enter your Question

Please select a Tag