Directory
Technology
Blog Details for "C CPP Blogging"
C CPP BloggingC CPP BloggingThis site features c,cpp programming, embbed systems programming for professionals and students Articles
Composition Over Inheritance
2007-02-27 13:25:05 Several Patterns books will always say that composition is preferred over inheritance, because it makes your code more reusable, and more flexible. Let’s see a usual example of this in C++, using pointers or references: /* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container {font-family: monospace;white-space: nowrap;height:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #0000ff;}.ch_code_container .kw2 ... More About: Comp , Composition , Over , Inheritance , Posi
A Simple Timer?
2007-02-27 01:24:10 I got inspired by an officemate’s suggestion (thanks sir Chie) to make a tool which allowed you to invoke a command and have it timed to the second. This is because we needed a tool which would run a script in a predetermined number of seconds, and cron was too clumsy to use. So with ... More About: Time , Simp , Simple , Timer
Can we use printf() in an ISR?
2007-02-22 01:20:03 No we cannot use printf() in ISR because ISRs’ are a part of kernel and kernel is not linked with libaray provided by C,so when we use printf() in ISR it should generate a linkage error. Miscellaneous, Question PatternsBookmark this post: More About: Print
Palindrome Checker
2007-02-21 01:20:02 Palindrome checker takes input from a file or keyboard, and lists out all palindrome words. This checker identifies even multiple words which are palindrome. This is a console based program, without arguments to the program, will act as a console shell, which takes input from keyboard and processes the words. Recursive string reversal function is used ... More About: Rome , Check , Hecker , Pali , Checker
Printing array spirally - c program
2007-02-17 13:17:01 Printing array in spiral order is not that tough as we think, if we properly maintain directions and positions of indexeswe are done, here is such simple program… /*Printing array spirally for ex. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 need to print the above matrix in 1, 2, ... More About: Rally , Print , Prog , Program , Inti
IEEE 754 Binary Floating Point Representation
2007-02-17 13:17:01 How the floating point values are stored? Note: Please note that this discussion is not related to the C Language. To be able to represent floating point numbers in the bit pattern, one needs to know about IEEE 754, the floating point specification. So, read patiently. IEEE Floating Point Format: --------------------------- 3 3 ... More About: Present , Presentation , Resent
ASCII Case Conversion
2007-02-17 13:17:01 /* * case_conv.c - Program to change case without using arithmetic * operators or library functions. This program * ... More About: Case , Sion , Conversion , Version , Ascii
Bus Error
2007-02-17 13:17:01 Bus error occurs when hardware tells the OS about a problematic memory reference. In practice, a bus error is almost always caused by a misaligned read or write. It’s called a bus error, because the address bus is the component that chokes if a misaligned load or store is requested. union { char a[10]; int i;}u; A ... More About: Error
How to distinguish parameter passing techniques?
2007-02-17 13:17:01 Before we see what the output of the program shown below is, let us learn how to distinguish two parameter passing techniques: pass by value and pass by address. Keep the following rule in mind:If the declaration of argument matches the declaration of the formal parameter, then the argument is passed by value. To be more ... More About: How To , Tech , Technique , Para , Sing
Data types in C
2007-02-17 13:17:01 The C programming language offers various data types to suit different purposes. They can be broadly categorized as follows: Integral types (char, short, int, long, long long, enum, _Bool) Real floating types (float, double, long double) Complex floating types (float _Complex, double _Complex, long double _Complex) (New feature void is an empty set of values Derived types (struct type, union ... More About: Data , Type , Types
Bit swapping - Style II
2007-02-17 13:17:01 This program shows a logic of swapping the most significant bit with the least significant bit, second most significant bit with the second least significant bit, and so on. /*! * swap-bits.c * Interchange bits of a byte in the following pattern: * bit7 <-> bit0 * bit6 <-> bit1 * bit5 <-> bit2 * bit4 ... More About: Wap , Style , Swap , Ping
Bit swapping - Style I
2007-02-17 13:17:01 This program shows a logic of swapping the most significant bit with the least significant bit, second most significant bit with the second least significant bit, and so on. /* * swap_bits.c - Swap corresponding bits*/ /* * This program swaps the corresponding bits of a character. For example, * 0; msb (bit 7) is exchanged with lsb ... More About: Wap , Style , Ping
String Reversal
2007-02-17 13:17:01 /*! * string_reverse.c: Reverse a string Feb 17, 2006 */ #include <stdio.h> #include <string.h> void reverse_str(char *str, int start, int end) { char c = str[start]; str[start] = str[end]; str[end] = c; start++; end–; if (start ... More About: Ring , Ever , String , Tring
How the keyboard works?
More articles from this author:2007-02-17 13:17:01 Keyboard input follows an event path beginning with the keyboard controller chip and ending with characters being placed in a 30-byte array called the keyboard typeahead buffer(predefined system data i.e. 0×001E to 0×003D in BIOS Data Area). Up to 15 keystrokes can be held there at any given moment, because each keystroke generates 2 bytes ... More About: Work , Board , Works , Keyboard 1, 2, 3 |



