Pages : 2649780070077928 Price : Rs.
250.
00
Professional
July 2009
CRACKING THE C, C++CRACKING THE C, C++
AND JAVA INTERVIEWAND JAVA INTERVIEW
9780070077928
Pages : 264
Price : Rs.
250.
00
S G Ganesh is currently
working at Siemens,
Bangalore.
He has also
authored the book 60 Tips
on Object Oriented
Programming.
PRIVACY NOTICE:...
Plus
Pages : 2649780070077928 Price : Rs. 250. 00 Professional July 2009 CRACKING THE C, C++CRACKING THE C, C++ AND JAVA INTERVIEWAND JAVA INTERVIEW 9780070077928 Pages : 264 Price : Rs. 250. 00 S G Ganesh is currently working at Siemens, Bangalore. He has also authored the book 60 Tips on Object Oriented Programming. PRIVACY NOTICE: Tata McGraw-Hill Education Pvt. Ltd. values your Privacy. From time to time The through this with other companies whose products or services we feel may be of interest to you. If you would like your name removed from these lists, please mail a written request to Tata McGraw-Hill Education Pvt. Ltd. B-4, Sector-63, Dist. Gautam Budh Nagar, Noida, UP-201 301 or email us at suman_datta@mcgraw-hill. com. For questions about our privacy ractices or to confirm the accuracy of your information, please contact Roystan La Porte, Privacy Official at Tata McGraw-Hill Education Pvt. Ltd. B-4, Sector-63, Dist. Gautam Budh Nagar, Noida, UP-201 301 or call at+9
Moins
Par sgganesh
Document Adobe PDF
Publiée le 2 Sept. 2009
Pages: 1
Lectures: 104
Téléchargements: 0
C is an attitude!
S.
G.
Ganesh
G.
R.
Prakash
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 42
Lectures: 1
Téléchargements: 0
Overview
September 2008 | LINUX For YoU | www.
openItis.
com72
Even if C is losing its position as the mainstream programming language for
general application development, embedded programming is still its stronghold.
Students and programmers new to embedded programming, though
proficient in general C programming, are often clueless...
Plus
Overview September 2008 | LINUX For YoU | www. openItis. com72 Even if C is losing its position as the mainstream programming language for general application development, embedded programming is still its stronghold. Students and programmers new to embedded programming, though proficient in general C programming, are often clueless about C programming for embedded systems. This article offers an introduction. very embedded system has software and hardware elements that are very closely dependent, and this affects how we program an embedded device. Based on this fact, we’ll look at the hardware characteristics of embedded devices, how the hardware affects the language chosen to write programs for it, how C is used differently for embedded programming and, finally, we’ll cover how GCC is used for embedded systems. Characteristics of embedded devices Programming for embedded systems is quite different from general programming (for PCs). The main difference is due to the underlying
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 4
Lectures: 33
Téléchargements: 0
88 AUGUST 2007 | LINUX FOR YOU | www.
linuxforu.
com
C M Y K
IIIII
n most of the cases, writing fractal programs requires a
good knowledge of mathematics.
The Mandelbrot set is
based on the theory and use of complex numbers.
The
Mandelbrot set is a collection of complex numbers, which
have two parts: real and imaginary.
Usually, a...
Plus
88 AUGUST 2007 | LINUX FOR YOU | www. linuxforu. com C M Y K IIIII n most of the cases, writing fractal programs requires a good knowledge of mathematics. The Mandelbrot set is based on the theory and use of complex numbers. The Mandelbrot set is a collection of complex numbers, which have two parts: real and imaginary. Usually, a complex number is represented in the form, a + bi , where a is the real part and b is the imaginary part (the suffix i indicates that). A complex plane has real numbers in the xaxis and imaginary numbers in the y-axis. Given the complex numbers Z and C, the Mandelbrot set is formed by the formula: Z = Z ** 2 + C. Here ** stands for square. C is the number we test to see if the number is inside or outside the set. We start Z from zero and keep reassigning it as we change C, using this formula. Given a complex number a + bi, the formula for finding the square of a complex number is: a**2 – b**2 + 2abi. So, the real part is a**2 – b**2 and the i
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 1
Lectures: 3
Téléchargements: 0
TABLE OF CONTENTS
0 INTRODUCTION AND BASICS 1
0.
0 C - AN OVERVIEW 1
0.
1 BRIEF HISTORY OF C LANGUAGE 2
0.
2 ANSI C STANDARD 3
0.
3 THE FUTURE OF C LANGUAGE 4
0.
4 THE LIFETIME OF A C PROGRAM 5
0.
5 SOURCE FILES 6
0.
6 TRANSLATION PHASES 6
0.
7 START-UP MODULE 7
0.
8 MAIN() 7
0.
9 COMMAND LINE ARGUMENTS 8
0.
10 PROGRAM TERMINATION 9...
Plus
TABLE OF CONTENTS 0 INTRODUCTION AND BASICS 1 0. 0 C - AN OVERVIEW 1 0. 1 BRIEF HISTORY OF C LANGUAGE 2 0. 2 ANSI C STANDARD 3 0. 3 THE FUTURE OF C LANGUAGE 4 0. 4 THE LIFETIME OF A C PROGRAM 5 0. 5 SOURCE FILES 6 0. 6 TRANSLATION PHASES 6 0. 7 START-UP MODULE 7 0. 8 MAIN() 7 0. 9 COMMAND LINE ARGUMENTS 8 0. 10 PROGRAM TERMINATION 9 0. 11 STRUCTURE OF A C PROGRAM IN MEMORY 9 0. 12 STRUCTURE OF A C PROGRAM IN MEMORY 10 0. 13 ERRORS 13 1 PROGRAM DESIGN 14 1. 1 PORTABILITY 14 1. 2 LANGUAGE FEATURES TO AVOID 20 1. 3 PERFORMANCE AND OPTIMIZATION CONSIDERATIONS 20 2 CONSTANTS, TYPES AND TYPE CONVERSIONS 23 2. 1 VARIABLES 23 2. 2 TYPES OF VARIABLES 24 2. 3 CONSTANTS 25 2. 4 SCALAR TYPE 26 2. 5 AGGREGATE TYPE 34 2. 6 VOID TYPE 34 2. 7 FUNCTION TYPE 34 2. 8 DERIVED TYPES 34 2. 9 INCOMPLETE TYPES 34 2. 10 TYPE SPECIFIERS 35 2. 11 TYPE QUALIFIERS 37 2. 12 LIMITS OF THE ARITHMETIC TYPES 40 2. 13 CREATING TYPE NAMES 41 2. 14 TYPE EQUIVALENCE 46 2. 15 TYPE CONVERSIONS 46 2. 16 EXPLICIT CONVERSIONS 4
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 6
Lectures: 3
Téléchargements: 0
September 2008 | LINUX For YoU | www.
openItis.
com106
S.
G.
GaneSh
The Joy of
Programming
C
/C++ allows only integer types for use in case
statements.
Why can’t we use floating point numbers?
Because C designers thought that it is not a good idea:
checking the exact equality in floating point is not portable
[ref: C99 rationale]....
Plus
September 2008 | LINUX For YoU | www. openItis. com106 S. G. GaneSh The Joy of Programming C /C++ allows only integer types for use in case statements. Why can’t we use floating point numbers? Because C designers thought that it is not a good idea: checking the exact equality in floating point is not portable [ref: C99 rationale]. How about string literals? It is allowed in many languages that evolved from C, such as C#, which is a useful feature. Since switch is for integral types, a compiler can translate it to efficient code, as we will now see. Which of the two is better: a switch statement or cascading if-else statements? Well, a switch expresses the programmer’s intentions more clearly than an if-else cascade. Also, you might be surprised to know that a switch is, in general, more efficient than an equivalent if-else statement sequence! Why? The if-else statement is flexible: it can have different conditions for each ‘if’ statement; also each condition can have (different)
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 1
Lectures: 1
Téléchargements: 0
106 MARCH 2007 | LINUX FOR YOU | www.
linuxforu.
com
C M Y K
CCCCC
ompile this program and run it by giving your name
as the argument.
Now find out how the program
works:
main(int i, char*a[]){char b[]={0x48,0x61,0x70,0x70,0x79,0x20,
0x62,0x69,0x72,0x74,0x68,0x64,0x61,0x79,0x20,0x74,0x6f,0x20,0x79,0x6f,
0x75,0x0a};while(i+2)...
Plus
106 MARCH 2007 | LINUX FOR YOU | www. linuxforu. com C M Y K CCCCC ompile this program and run it by giving your name as the argument. Now find out how the program works: main(int i, char*a[]){char b[]={0x48,0x61,0x70,0x70,0x79,0x20, 0x62,0x69,0x72,0x74,0x68,0x64,0x61,0x79,0x20,0x74,0x6f,0x20,0x79,0x6f, 0x75,0x0a};while(i+2) printf((!i—)?”%. 15sdear %s\n”:”%s”,b,1[a]);} Given your name, say, Bala, it wishes you happy birthday: Happy birthday to you Happy birthday to you Happy birthday, dear Bala Happy birthday to you That’s nice, isn’t it! Instead of starting by dissecting the given obfuscated program, let me start from the original program and explain how one can arrive at the obfuscated code (because that’s the way almost all obfuscated programs are written). Here is the original program: const char * str = “Happy birthday to you\n”; int main(){ const char name[50]; gets (name); printf(“ %s %s %. 15s%s %s”, str, str, str, name, str); } The idea is to print the string “Happy birthda
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 1
Lectures: 4
Téléchargements: 0
98 JANUARY 2008 | LINUX FOR YOU | www.
linuxforu.
com
C M Y K
Insight
On the Notion of
Object-Oriented
Programming
This article discusses the fundamentals of object orientation, and in the process dispels
some myths about it.
Insight
98 JANUARY 2008 | LINUX FOR YOU | www.
linuxforu.
com
C M Y K
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 3
Lectures: 9
Téléchargements: 0
c m y k
85www.
openITis.
com | LINUX For YoU | AprIL 2008
W
hen we hear of some strange algorithms
with names like ‘Dijkstra’s shortest path’,
‘Markov’s string replacement’ or ‘Sieve of
Eratosthenes’, we usually dislike the arcane and dry
solutions they describe.
However, such algorithms
can have interesting...
Plus
c m y k 85www. openITis. com | LINUX For YoU | AprIL 2008 W hen we hear of some strange algorithms with names like ‘Dijkstra’s shortest path’, ‘Markov’s string replacement’ or ‘Sieve of Eratosthenes’, we usually dislike the arcane and dry solutions they describe. However, such algorithms can have interesting applications or can provide some unusual solutions that are not possible with the straightforward solutions we often arrive at based on common sense. We’ll explore ‘Markov’s string replacement’ algorithm in this article. What this algorithm does is simple string rewriting based on a set of rules. Let’s look at an interesting application of this algorithm: converting a binary to unary by string replacement, by applying a set of rules. The idea described here is from en. wikipedia. org/wiki/Markov_algorithm Let us look at the rules first: • Rule 1: “#0” => “0##” • Rule 2: “1” => “0#” • Rule 3: “0” => “” • Rule 4: “#” => “1” The symbol ‘=>’ stands for ‘replace with’. Take any bi
Moins
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 1
Lectures: 1
Téléchargements: 0
Comparing C++,
Java and C#
A Broad Perspective
Par sgganesh
Document Adobe PDF
Publiée le 7 Juin 2009
Pages: 40
Lectures: 3
Téléchargements: 0