variables and functions naming convention in c applications [closed] - c

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have made a C application using vs 2010 and have followed lowercase with underscores as the naming convention for variables and functions in the application. I am asked to follow the camel case in the entire application. I want to ask whether this is the correct approach for the naming convention in c if yes then Is there any tool that can convert all the variables and functions to camel case in the existing c application.

Coding standards vary from company to company. Most mature companies have one, and there is probably some old code lying about somewhere that doesn't follow it.
As long as the coding is done to a consistent style, so you know the name of the function that checks if the car-door is open in your application, whether it is called car_door_open, CarDoorOpen, cardoorisopen matters a lot less. The key is consistency.
I'm not aware of a tool that can rename all identifiers in your code, but modern IDE's have a "rename this identifier", which can be really helpful for these type of things.

Related

How to start building a programming language in C? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I really would love to go through the experience of building a compiler, lexer, and so on using C, however I havn't found a single resource on creating one. I've read the book about creating your own language using Ruby, but it just talks about how C is the best option, and won't tell you where to go from there.
Is their any nice resources for building a language using C? I don't care how long it is, I just want to know how to build one.
One of the nice things about compilers/interpreters is that it doesn't really matter what language they are written in. In the final stage they will just be an executable on someone's machine.
That being said while writing my compiler (something I am currently doing) I have used several books that have been extremely helpful:
Compiler Construction by Niklaus Wirth
Compilers Principles, Techniques, and Tools by Jeffrey Ullman, Alfred Aho, Ravi Sethi
The Wirth book will walk you through all the stages of creating a compiler for a language called Oberon-0. It also has the entire source code for his finished compiler, so you can play around with it on your own machine. The compiler itself was written in Pascal (something else that Wirth created).
The Dragon Book has really good information and examples in C! This may be what you are looking for, but as I said above, the language you write the compiler in isn't all that important.

Compiler/language runtime vs. Middleware [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are the specific operations a language runtime does that an operating system does not? How is a language runtime different from a middleware?
This depends on the operating system and the runtime. libc is a good example of a language runtime and the linked article on Wikipedia gives a good overview of what it does. Generally the goal of a language runtime is to provide implementations of standard basic functionality which is likely to be implemented differently between the operating systems the language supports, or functionality which is extremely common, but not provided by the operating system.
Middleware is a very general concept but it simply refers to software placed between two systems as an abstraction layer. You could consider a language runtime as a form of middleware in some contexts.

Why does the C89 library not contain functions to create/delete/rename/remove a directory? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I apologize for my bad English.
Why does the C89 library not contain functions to create/delete/rename/remove a directory? Or maybe I didn't find that? I see functions for some file operations only, but not for directories.
Thank you
Best Regards
Otherwise, <dirent.h> header file is now pseudo-standard: both MinGW and GCC have it. So, you can handle directories on a conventional personnal computer, without too much trouble.
Traditionally (and C89 is tradition) the directory structure is seen as part of the operating system, and at the time (1989) there were still OS arround that had incompatible concepts for that.
Nowadays, there would perhaps be enough common ground to integrate such a thing in C, as it is e.g now done for threading in C11, but I am not aware of an initiative to do so.

In embedded application why c is most poppular? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
see ,
still yet i have seen that most of the embedded application are written in c.
Most of the libraries are written in c.
Device-driver are written in c.
So i want to ask you is there any logical reason behind this?
(My apologies if this post sounds silly/stupid. I thought I'd ask here. Ignoring these core bits never made anyone a better programmer.)
There are many reasons, including but not limited to:
It has access to many low level functions not accessible from many other languages.
It has existed for many many years and has lots of developers that are familiar with it.
If written well it's extremely efficient.
It gives almost complete control over memory etc.
It's very portable, largely due to the myriad of compilers written for it.
Because of Dennis Ritchie. C is easily the most portable language.

What's the deal with glibc? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I know it's a standar c library, but I don't understand why c doesn't have a free library, not one that is lgpl. Is there any such library and if not, than that means every company/particular developer has to buy even the most basic libraries to develop commercial apps ?
every company/particular developer has to buy even the most basic libraries to develop commercial apps ?
Well, they have to buy (or get for free) the compiler anyway, and libc comes with it.
Also, writing an universal C library is impossible, since exit(), setjmp(), etc. depend on the particular compiler and platform.

Resources