Thursday, 13 February 2014

23 Tips And Tricks For C Programmers

C programming, C tips and tricks, tips and tricks on C, programming tips, programming tricks, programming tips and tricks, C tricks, C tips, learn C, learn programming The minimalistic C Programming language is considered by many to be 'the' programming language. Although it is old and newer and more powerful languages have arrived, C remains an important part of a programmer's arsenal. It allows the programmer to read and write code for a large number of platforms and everything from microcontrollers to the most advanced scientific systems can be written in C, and many modern operating systems are written in C.

Here are a few tips and tricks for the C Programming language that you may use.


General

1. Timer - When you need to display the time for how long a piece of code took to execute.

2. Comment out blocks of code - This is used to tell why a piece of code is not being used anymore.

3. Macro Tips - Watch out for these things when you’re using Macros.

4. Factorial - Use NOT to calculate factorials.

5. Powx - This is the quick exponentiation function.

6. Saturated Addition - Use this for when you’re adding numbers but want to make sure that the total doesn’t overflow.

7. FNV Hash - Use this when you need to hash large amounts of data.

8. Seeding rand() - Seeding random number generators for returning different values everytime.

String Handling

1. Check if two strings are equal - Checking whether strings are equal or not.

2. Stringise Preprocessor Arguments - Insert an arguments to a macro within a string.

3. Text Editing - It is better to use a text editor from the environment that writing one of your own.

4. Display Time - Use this to display time in a easier format than displaying huge number of seconds.

5. Temporary Return Buffer - Return char* without any leaks.

Data Structures

1. Intro to bitwise operations - Learn how to use bitwise operations.

2. Count Bits - Find the number of bits that have been sent in an unsigned int.

3. Binary Constants - These are macros that allow you to use binary constants directly in your code.

4. Digit Mask - Use this macro in order to pull out one digit from a particular number.

5. Bit Manipulation - This will be used in order to test, flip and set individual bits.

6. Coordinate compression - You can turn multidimensional array units into one int using this.

Debugging

1. Debug Messages - The pre-processor can be used in order to compile in debugging messages.

2.Assert - Assert is a standard library function. This function tells you in which line of which file it failed at. The value passed to assert needs to be zero for this though.

3. #error - Want to create your own compile errors? This is how.

4. GDB - This is an introduction to using the GNU debugger.



Author : Shivam Kotwalia, CodeKill

No comments:

Post a Comment

Blog Archive

Labels

Tutorial (129) Tech News (83) E-Books (55) Pdf (47) Hacking (46) Linux (32) Android (23) Programming (22) Tools (22) Video (21) Ethical Hacking (16) Electronics (12) Google (10) Hacked (9) Python (9) Facebook (8) Java (8) Software (8) PHP (7) Android App (6) C (6) Free Online Coureses (6) OpenSource (6) Ubuntu (6) Unix (6) Windows (6) C++ (5) Game Programming (5) Java Programming (5) Kali Linux (5) CodeKill (4) Cryptography (4) Firefox (4) JavaScript (4) Linux System Administrator (4) Mac (4) Penetration testing (4) Python Programming (4) Security (4) Top Distros (4) WhatsApp (4) CSS (3) Circuit (3) Cloud Computing (3) Game Devlopment (3) Hacking Tools (3) Malware (3) MicroController (3) Microsoft (3) Networking Tool (3) Perl (3) Source Code (3) WebSite (3) Windows 8.1 (3) C Programming (2) C Series (2) C# (2) CheetSheet (2) Computer (2) Computer Networking (2) Data Storage (2) Dual Boot (2) Eclipse (2) Edward Snowden (2) Exploit (2) Facts (2) Games On Linux (2) Google Chrome (2) HTML5 (2) Hacking Challenges (2) IDE's (2) Information Security (2) Lenovo (2) Linux Kernel (2) Malicious (2) Mobile (2) Motorola (2) Mozilla (2) MySQL (2) NoSQL (2) Raspberry Pi (2) Ruby (2) Security Tools (2) Syrian Electronic Army (2) Tricks and Tips (2) Valentine Day (2) Web Design (2) iOS (2) iPhone (2) jQwery (2) *nix (1) 2014 (1) 3D Modeling (1) Algorithm (1) Android Hacking (1) Android Pattern Lock Screen.. (1) Anonymous Mail (1) Anti-Spam (1) Apps (1) Arduino (1) Artificial Intelligance (1) Audio Software (1) BSD (1) BeAWARE (1) Bitcoin (1) Black Hat Hackers (1) BlackBerry (1) Buffer Overflow (1) C++ vs Java (1) CISO (1) Circuit Analysis (1) Circuit Design (1) Circuit Programming (1) Circuit Simulators (1) Codes (1) Crptology (1) Cryptanalysis (1) DDOS (1) Devlopers (1) Drupal (1) DuckDuckGo Search Engine (1) E-Card (1) E-Mails (1) Embedded System (1) Encryption Tools (1) Error (1) FTP (1) Famous Passwords (1) FileZilla (1) Flipkart (1) Forbes (1) Forgot Password (1) GCHQ (1) Genders (1) Gmail (1) Google Tricks and Trips (1) HTML (1) Hacking Distro (1) Hard Disk (1) Hash Encryption (1) Illegal (1) Internet (1) LAMP (1) Language Theory (1) LibreOffice (1) Linus Trovalds (1) Logic Gates (1) MATLAB (1) MOSFET (1) Mail (1) Mark Zuckerberg (1) Mathematical (1) MicroProcessor (1) Mind Mapping Tools (1) Myntra (1) NoSQL Database (1) Nobal Prize (1) Nokia (1) Object Oriented Programming (1) Office (1) Oldboot (1) Online (1) Paranoid Android (1) Passwords (1) Passwords Cracking Tools (1) PayPal (1) Perl Programming (1) Plugins (1) Prolog Programming (1) Python Basics (1) Remote (1) SEA (1) SQL Injection (1) Sans (1) Screencasts (1) Screenloggers (1) Server Load (1) Servers (1) Shell (1) Software Design (1) Software Developer (1) Software Testing (1) Sony (1) Spider.io (1) Statistical (1) Steve Jobs (1) TCP/IP (1) Timeline (1) Tor (1) Trojan (1) Ubuntu Phones (1) VAIO (1) Virus (1) Web Designers (1) Wi-Fi Hacking (1) Windows Tools (1) Windows XP (1) WordPress (1) XML (1) Yahoo (1) YouTube (1) cpp (1) eBay (1) iBanking (1)