How Do I Use RSS?

Monday, June 20, 2011

Setting up an RSS feed differs from one reader to the next, but typically involves clicking on the icon on the page you want to subscribe to and copying the URL from this feed and pasting it into your reader. Whichever method you choose to view RSS feeds, setting up a reader is an easy, user-friendly process.

To view RSS feeds, you collect all the feeds that interest you in one place, either a web page or software on your computer. You can use one of the increasingly popular and user-friendly web-based readers, such as Google Reader, or My Yahoo.

Why Use RSS?

RSS is an easy way for you to check when content that interests you has been published on (and many other sites), without having to continually visit each of them. Your RSS news reader will scan multiple times daily (typically hourly), always updating its display to show the most recent content posted to

What Is RSS?

RSS, short for Really Simple Syndication, enables you to subscribe to content feeds from your favorite sections of Each feed will contain headlines of 15 of the most recent stories published on, as well as a short description of the article and a link to the story.

RSS feeds collect and distribute the articles listed on any pages on where you see the button.

What does namespace mean in .NET?

Thursday, June 16, 2011

A namespace is a very simple concept. Within your program code and within the code that forms the .NET libraries, names have to be given to lots of things — data types, variables, and blocks of code called functions all have to have names. The problem is that if you happen to invent a name that is already used in the library, there ’ s potential for confusion. A namespace provides a way of getting around this problem.

All the names in the library code defi ned within the System namespace are implicitly prefi xed with the namespace name. So a name such as String in the library is really System::String . This means that if you have inadvertently used the name String for something in your code, you can use System::String to refer to String from the .NET library without confusing it with the name String in your code.

The two colons ( :: ) are an operator called the scope resolution operator . Here the scope resolution operator separates the namespace name System from the type name String . You have seen this operator in the native C++ examples earlier in this chapter with std::cout and std::endl. This is the same story — std is the namespace name for native C++ libraries, and cout and endl are the names that have been defined within the std namespace to represent the standard output stream and the newline character, respectively.

In fact, the using namespace statement in this example enables you to use any name from the System namespace without having to use the namespace name as a prefi x. If you did end up with a name confl ict between a name you defi ned and a name in the library, you could resolve the problem by removing the using namespace statement and explicitly qualifying the name from the library with the namespace name.

What is Pointer Arithmetic of C++

Wednesday, June 15, 2011

The addition and subtraction operators are also applicable to pointers. It is called pointer arithmetic. An integral value can be added to or subtracted from a pointer. The value of the pointer is then changed by the integral value times the size of the type the pointer points at. As the void type is not really a type, but rather the absence of a type, it has no size. Therefore, we cannot perform pointer arithmetic on pointers
to void.

In the code below, let us assume that iNumber is stored at memory location 10,000 and that the integer type has the size of four bytes. Then the pointer pNumber
will assume the values 10,000, 10,004, 10,008, and 10,012, not the values 10,000, 10,002, 10,003, and 10,013, as pointer arithmetic always take the size of the type
into consideration.

int iNumber = 100;
int* pNumber = &iNumber;
pNumber = pNumber + 1;
*pNumber = iNumber + 1;
pNumber = pNumber + 1;
*pNumber = iNumber + 2;
pNumber = pNumber + 1;
*pNumber = iNumber + 3;

It is also possible to subtract two pointers pointing at the same type. The result will be the difference in bytes between their two memory locations divided by the size of the type.

int array[] = {1, 2, 3};
int* p1 = &array[0];
int* p2 = &array[2];
int iDiff = p2 - p1; // 2

The index notation for arrays is equivalent to the dereferring of pointers together with pointer arithmetic. The second and third lines of the following code are by definition interchangeable.

int array[] = {1, 2, 3};
array[1] = array[2] + 1;
*(array + 1) = *(array + 2) + 1;

What is Arithmetic Operators of C++

The arithmetic operators are addition (+), subtraction (-), multiplication (*), division (/), and modulo (%). The first four operators are equivalent to the four fundamental rules of arithmetic. The operators can take operands of integral and floating types. The last operator—modulo—gives the remainder of integer division. If we mix integral and floating types in the expression, the result will have floating type. The modulo operator, however, can only have integral operands. The last assignment in the following code may give rise to a compiler warning as the result of the division is a double and is converted into an int.

For example:
int a = 10, b = 3, c;
c = a + b; // 13
c = a - b; // 7
c = a * b; // 30
c = a / b; // 3, integer division
c = a % 3; // 1, remainder
double d = 3.0;
c = a / d; // 3.333, floating type


Recent Posts

Recent Comments