what is the relationship between c and win32? [closed]
why c method using in win32
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.
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.
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.
What Programming Language is Windows written in?
Win32 was derived from the Win16 API.
When the Win16 API was developed there were two main programming languages for Windows: C, and assembly.
Win32 provides a set of APIS which can be called by a program written in C. C FYI is a programming language.
If you mean why Win32 API is composed by C functions, the reason is that the Windows operating system itself is written in C.
精彩评论