What is the difference between exit(0) and exit(1) in C?

What is the difference between exit(0) and exit(1) in C language? exit(0) indicates successful program termination & it is fully portable, Whileexit(1) (usually) indicates unsucessful termination. However, it’s usage is non-portable. Note that the C standard defines EXIT_SUCCESS and EXIT_FAILURE to return termination status from a C program. 0 and EXIT_SUCCESS are the values specified by the standard to indicate successful termination, however, only EXIT_FAILURE is the standard value for … Read more

Categories C Tags

What is a file with extension .a?

.a files are static libraries typically generated by the archive tool. You usually include the header files associated with that static library and then link to the library when you are compiling.

What is the difference between Cygwin and MinGW?

As a simplification, it’s like this: Compile something in Cygwin and you are compiling it for Cygwin. Compile something in MinGW and you are compiling it for Windows. About Cygwin Cygwin is a compatibility layer that makes it easy to port simple Unix-based applications to Windows, by emulating many of the basic interfaces that Unix-based operating systems … Read more

Strange symbol shows up on website (L SEP)?

That character is U+2028 or HTML entity code 
 which is a kind of newline character. It’s not actually supposed to be displayed. I’m guessing that either your server side scripts failed to translate it into a new line or you are using a font that displays it. But, since we know the HTML and UNICODE vales for the … Read more

How can I write a regex which matches non greedy?

The non-greedy ? works perfectly fine. It’s just that you need to select dot matches all option in the regex engines (regexpal, the engine you used, also has this option) you are testing with. This is because, regex engines generally don’t match line breaks when you use .. You need to tell them explicitly that you want to match line-breaks … Read more

How do I make a python script executable?

Add a shebang line to the top of the script:#!/usr/bin/env python Mark the script as executable:chmod +x myscript.py Add the dir containing it to your PATH variable. (If you want it to stick, you’ll have to do this in .bashrc or .bash_profile in your home dir.)export PATH=/path/to/script:$PATH