Online C programming test | C programming Interview Questions and Answers
While surfing net i got one site which has excellent for doing Online c programming test. All Question are also divided by section vise like pointers, structures,functions..
Link: IndiaBix
Why fopen() doesn’t get fail by passing directory name in argument?
Once i have made one small application where i was passing full file name as command line argument in my application where i am going to fopen() that file BUT once i have just passed any directory name instad of file name still my fopen() does not get fails…!!
#include<stdio.h> #include <errno.h> int main() { errno = 0; FILE *fb = fopen("/home/jeegar/","r"); if(fb==NULL) printf("its null"); else printf("working"); printf("Error %d \n", errno); }
output is
workingError 0
here fb is not going null and also not getting any error..
Whats is difference between file descriptor and file pointer?
After having 1 year of experience in c programming when someone has asked this to me i was surprised that why i dont know this…!!
Well when i will going to interview someone in someday this would be my 1st question to him/her…!!!
File Descriptor :
“A file descriptor is a low-level integer “handle” used to identify an opened file (or socket, or whatever) at the kernel level, in Linux and other Unix-like systems.”
int fd; fd = open(path, O_CREAT | O_RDONLY, 0644); close(fd);
This way you are using that is file-descriptor. In short, file-descriptor is
- Low/Kernel level handler
- passe to read() and write() of UNIX System Calls
- Doesn’t include buffering and such features
- Less portable and lacks efficiency
- It’s some what OS specific so its not part of standard c programming language.
How can i use GCC in windows/cmd just like using gcc in linux terminal?
At work i use gcc in linux but at home i use windows so i need to figure out the way of using gcc in cmd of windows just like using gcc in linux terminal. Since i dont like to use IDE such eclipse and neatbeans.
i came to know three option
1> Use Cygwin package
2> Use MinGW
3> Use MSYS
Well among all of them i have chosen option of using Cygwin package because
- Cygwin is a collection of tools which provide a Linux look and feel environment for Windows.
- a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.
Steps to install and configure cygwin :
Implementation limitation of c programming language
One day i thought ,
“What is the maximum number of arguments we can pass to a function in C ?”
i have searched some stuff and found following things.
As per International Standard of c programming language, an implementation translates C source files and executes C programs in two dataprocessing-system environments, which will be called the translation environment and
the execution environment.
As per logicaly we can pass infinite number of aguments to the function but the Limitation of such data processing-system environment makes following limitation to the implementation of c programming language .
From : C language standard n1256
5.2.4.1 Translation limits
Cdecl – Best friend for c-language beginner | Know what your c code says
While surfing net one-day i got this magic…………..!!
The new, AJAX-powered version of the “C gibberish ↔ English” translation tool cdecl.
It will says you what your c programming sentence says and also make a c program sentence by just saying the meaning of that. so got it ? no then let me show you example
1> C gibberish to English translation.
char (*(*x())[5])()
if i do not understand above sentence then this tool will help you to understand this sentance
just write that c programming sentence in this tool and press enter.
List of free C and C++ Compilers for Linux and Windows
In previous post i have written about most famous IDE of C and C++ programming language. So here i am going to write about most famous compiler for C and C++ programming language.
MinGW
Pelles C- Compiler based on LCC
see this also
Top/Best C/C++ IDE for Windows & Linux
Top/Best C/C++ IDE for Windows & Linux
How much time gone in project design & building logic that much time also gone in writing code So if you have better IDE then you can work faster and easily. So i am going to introduce you most famous IDE for C/C++ programming on Linux & windows.
1>Eclipse CDT (C/C++ Development Tooling)
how can I write applications in C or C++ for Android?
Most of the people know that Development of Android Application is only done in java programming language. But Reality is that Development of Android application can be done in native languages like C & C++.
I have 3 option to do this all.
1> For doing this You need to use Android NDK
How to detect memory leakage in C program?
One more tips for c-programmer,embedded software engineers.
- In many case you need to make sure that your programs is not going to leak any heap memory.
- In Manny case while debugging code you will find SEGMENTATION FAULT and you cant debug your code ahead.
So in that all case our best friend is Valgrind
Introduction:
The Valgrind tool suite provides a number of debugging and profiling tools that help you make your programs faster
and more correct. The most popular of these tools is called Memcheck. It can detect many memory-related errors
that are common in C and C++ programs and that can lead to crashes and unpredictable behaviour.
Download & install :
You can download this tool for For {x86,amd64,arm,ppc32,ppc64}-linux and {x86,amd64}-darwin (Mac OS X). from here.
read more
Search in this website
our sponsors
latest comments
- JIGAR PATEL on List of all standard version of c language
- agabein on List of all standard version of c language
- David Wood fin on Stop Plugin from showing updates
- Alice on C programming interview questions and answers for freshers
- smitesh on How to access/unblock songs.pk in india?
Find us on Facebook
Top Authors
Find us on stackoverflow
Polls
My Bookmarks
- Audio/video Recorder & player application based on MATLAB
- check dependency of your binary
- defination of all standard c programming language function
- Great Question-Answer on c programming
- know what your c code means
- Limition of c programming language
- List of all version of c programming language
- Online c compiler
- php freelancing work
- some more stuff on C programming language
- Volatile Keyword in Embedded System
- Write Android application in c language