tags:

views:

97

answers:

7

why c method using in win32

+1  A: 

I don't really understand your question. C is a language. It also happens to be the language Windows is (mostly) written in and the native language of the Win32 API but many languages are capable of calling C APIs and using libraries written in C.

Konrad
A: 

Win32 was derived from the Win16 API.

When the Win16 API was developed there were two main programming languages for Windows: C, and assembly.

ChrisW
A: 

Win32 provides a set of APIS which can be called by a program written in C. C FYI is a programming language.

Praveen S
A: 

If you mean why Win32 API is composed by C functions, the reason is that the Windows operating system itself is written in C.

Lorenzo
+1  A: 

I read this as: "Why does the Win32 API use C?"

And what's wrong with their choice of C? :-)

The Windows API dates back a long way, well before the advent of 32-bit programming on PCs. At that time (1983-ish), C was the most widely used systems language, and enjoyed strong compiler support on PCs. C++ was still in its infancy. Those factors probably made the initial choice of C a bit of a no-brainer.

As to why it's stayed in C, C is still a high-performance and very effective systems programming language, and Microsoft has little incentive to toss the massive investment they have in that C codebase. Plus, Microsoft has been careful to maintain backwards compatibility for users, which means preserving not just the API but the language the API is written in.

Owen S.
+1  A: 

There's a good reason why any operating system's API should be (and almost always is) written in C or a similarly low-level language: It's easy for high-level languages to wrap and use an API from a lower-level language, but it's difficult or impossible to do the reverse without incurring so much overhead that the whole usefulness of the low-level language is lost.

R..