Skip to main content

Facts you don't know about C language...

Most of us think that c language doesn't support polymorphism. But actually it does, think i am wrong, actually i can prove it to you..

Consider a normal printf statement, it looks something like :

              printf("hai");

It also accepts another type of arguments:

              printf("%d",&a);  //assume a is an integer variable.

Now printf is an in-build function, it accepts two different type of arguments. In the first example it accepts a string variable , in the second one it accepts an integer variable, moreover it accepts different number of arguments, this points to the concept of function overloading which is a branch of polymorphism.

C even supports operator overloading:

& symbol-- the address operator as most of us  know..but it can also be noted as a bit and operator
 too. Hence a single operator can be used for multiple purposes,

There is another operator that is used for two operations.

* one is used as a pointer.
 * arithmetic multiplication operator.

Most of us don't look deeply into these facts, C also supports functional and operator overloading, but it is limited to the system built-in functions,
Now in C++ these capabilities are extended to the user defined functions, and thus the concept of polymorphism emerges.

Hope this was something new....:) 

Comments

Popular posts from this blog

how make a good blog post!!

Most of us write blog for very many different reasons, but the sole purpose stands on the fact that we want to gain some attraction and popularity. The best way to do that is to be the best at what you do. The art of writing a famous blog is not an easy task, it takes time and patience, it is so because blogs are  one of the fastest-growing means of mass communication, they have gained a lot of attention since the 2000 and they are a now becoming a serious rival for traditional media like newspaper and other mass media. So here the few tips that I think will result in a good blog post if followed thoroughly: 1.      As the old saying goes “plan well before you do anything”, first  choose what type of blog you want to create. Have a rock solid idea about your main theme. The main success of the blog lies in the fact that you should consider your blog as an extension of yourself. Your blog identifies who you are. It exposes the person who you are on ...

AMAZING FACTS ABOUT WARREN BUFFET: 3rd RICHEST MAN IN THE WORLD:-

1) Warren bought his first share at age 11 and he now regrets that he started too late! 2) He bought a small farm at age 14 with savings from delivering newspapers. 3) He still lives in the same small 3 bedroom house in mid-town Omaha, that he bought after he got married 50 years ago. He says that he has everything he needs in that house. His house does not have a wall or a fence. 4) He drives his own car everywhere and does not have a driver or security people around him. 5) He never travels by private jet, although he owns the world's largest private jet company. 6) His company, Berkshire Hathaway, owns 63 companies. He writes only one letter each year to the CEOs of these companies, giving them goals for the year. He never holds meetings or calls them on a regular basis. 7) Warren Buffet has given his CEO's only two rules. Rule number 1: Do not lose any of your share holder's money. Rule number 2: Do not forget rule number 1. 8) He does not socialize with the hig...

How Embracing AI Transformed My Everyday Life

I still remember the first time I spoke to a virtual assistant. It was a chilly morning, and I was running late for a meeting. Frustrated with my disorganized schedule, I hesitantly said, “Hey Siri, set a reminder for my 10 AM meeting.” To my surprise, it worked seamlessly. That simple interaction marked the beginning of a transformative journey with Artificial Intelligence (AI) that has profoundly changed how I live, work, and connect with others. For over three years, I’ve witnessed technology evolve at an unprecedented pace. Yet, nothing has impacted me as personally and profoundly as the integration of AI into my daily routine. I’d like to share how embracing AI not only streamlined my life but also helped me become better at what I do. A Personal Assistant in My Pocket Juggling a demanding career and personal life often left me feeling overwhelmed. Deadlines were missed, birthdays forgotten, and important emails buried in my inbox. But everything changed when I started using AI-po...