ss_blog_claim=726e70d7c87c20ae33aa7a61f06eb8aa

Friday, November 28, 2008

The usage of ‘gets’ statement in C Programming

Well we have already discussed about the usage of ‘fflush’ statement, let us now discuss about the usage of ‘gets’ statement. String is an array of characters and we use the format specifier ‘%s’ to directly get these array of characters, which is not possible in the case of array of integers. In the case of array of integers we use the ‘for’ loop to get the values since we don't have any format specifier for array of integers.

To get array of characters we use the format specifier ‘%s’ as shown below

puts(“Enter the string”);
scanf(“%s”,ex_str);
puts(ex_str);

Output:

Enter a string
sample text
sample

What is wrong in the output?? We know that ‘Space’ and ‘Enter’ key act as a delimiter. So if you execute this program and give input as ‘sample text’ the value stored in ‘ex_str’ is ‘sample’ and not ‘sample text’ this is because the space in between the words ‘sample’ and ‘text’ acts as a delimiter thus storing only ‘sample’ in the character array (string). To overcome this problem we use the ‘gets’ statement. The ‘gets’ statement takes only the ‘Enter’ key as delimiter. The below part of the code shows how to use ‘gets’ statement.

puts(“Enter a string”);
gets(ex_str);
puts(ex_str);

Output:

Enter a string
sample text

sample text

Just think of getting a name of a person which contains first name, last name and middle name so this ‘gets’ statement is much useful in those situations. Happy Programming!!

Thursday, November 27, 2008

Holiday Frames for your Holiday Trips

Struggling to find out a good gift for your friend, then you could get cool looking Holiday Glass Frames From Zenni Optical. Your travel bag lags an important thing, if you don’t get one of these Holiday frames for your trip. The Acetate full Rim frame with template design looks awesome, you can see it above. Zenni Optical is The popular online eyeglasses shop where you can get best quality products at lowest prices. You could get $ 8 Complete Rx Eyeglasses from Zenni Optical. The site provides a list of eyeglasses of various designs and colors that you can choose the one that best suits you. Just visit the site for looking at much more awesome designs.

Saturday, November 15, 2008

The usage of ‘fflush’ statement in C programming

The keyboard has an input buffer in it and every time you read data from the keyboard the value stored in the input buffer is read. For every key press there will be a value loaded into the input buffer which means that the ‘Enter’ key, ‘Tab’ key also has a value being stored in the buffer when pressed.


We know that the ‘Enter’ key and the ‘Tab’ key acts as a delimiter while accepting data. Consider the below C Program

void main()
{
int num;
char ch;
clrscr();
printf(“Enter a number\n”);
scanf(“%d”,&num);
printf(“Enter a character\n”);
scanf(“%c”,&ch);
printf(“The value of num is %d and ch is %c”,num,ch);
getch();
}

The output of the program is shown below

Enter a number
12
Enter a character
The value of num is 12 and ch is

Wonder why this happens? Well let us look at the problem. When you type the number 12 and press ‘Enter’ key, the value corresponding to key press ‘1’ and ‘2’ is read from the input buffer and gets assigned to the variable ‘num’ once you press the ‘Enter’ key(delimiter). Now the value of the ‘Enter’ key is stored in the input buffer. So when you want to read a character, the value of the ‘Enter’ key which is stored in the input buffer is assigned to the character variable ‘ch’. This results in giving a wrong output. This is where the ‘fflush’ command comes into picture. The ‘fflush’ clears the specified buffer, so after getting the integer value we need to clear the input buffer (which stores the ‘Enter’ key value) before getting the character value. So the C program is changed as shown below.

printf(“Enter a number\n”);
scanf(“%d”,&num);
fflush(stdin);
printf(“Enter a character\n”);
scanf(“%c”,&ch);

Hope you know understood the importance of ‘ffush’ statement

Tuesday, November 11, 2008

Best Laptop Reviews

Home PC’s have turned out into personal laptop. With the reduction in the cost of laptop most of the people nowadays prefer to buy laptop rather than buying a Home PC. The compact size, stylish look and added features make the option of laptop a better choice. There are many factors that need to be considered before buying a laptop like the aftermarket support, configuration, warranty period, etc. Laptopcommunity.com is a unique site that provides information about the various top brand laptops and their features. The site provides honest reviews on each model and rating that helps you to know the best laptop in the market. You can read through the full article on your favorite laptop and look at its rating under various fields. You can read through the user reviews on various laptop brands which will be very helpful to you. The reviews on hp laptop helped my friend to make his decision on choosing the model. He then took the hp pavilion 2710 Tx model and now he is feeling very much comfortable on his decision. For him the information was very much useful in making the decision hope you could also benefit like him. Just visit the site and look at the pile of information on various laptop brands before buying them.

Monday, November 10, 2008

Types of ROM's

We have been hearing the terms volatile memory and non-volatile memory from our 1st year of college. Here is a brush up of what we have heard so far.
The OTP (one time programmable) are used for firmware applications.
The ROM is also known as the program memory or code memory and RAM is also known as the data memory.
The EEPROM are electrically erasable PROM and needs electrical supply to clear the data.
The UVPROM requires UV light to pass through the window to clear the data.
The FLASH ROM are the advanced ones where data is loaded and retrieved in blocks, where each block is greater than 2 bytes, so the operation is faster in the case of FLASH ROM, whereas in the case of EEPROM data is loaded and retrieved byte by byte so it would take much time to access data when compared to FLASH ROM.

Friday, November 7, 2008

Drive more traffic to your site

Having a high Page rank matters, but maintaining the Page rank matters much more. Some of my friends have sites having PR3 and above but within a month there PR dropped to 0. Some of the facts that boost the Page Rank are having high back links from Page Rank domains, having good number of visitors, etc. Once your site has a good PR your site gets much priority during search operations related to the content of your site. Search engine optimization plays a key role in deciding your page rank. There are various SEO tools available to boost your sites page rank. These SEO software tools helps in building volume and quality of traffic to your site and helps in getting a good page rank and maintain it. Now internet has become global media for advertising and the sites which has good Page rank can get many offers for giving links from their domains, so these Online Marketing Tools is surely going to be an initial investment to you. The site provides you a list of various SEO services that would boost your traffic. The owner of the site had shared his 5 years experience regarding SEO and the reviews would surely help you out in choosing the best SEO software.

Monday, November 3, 2008

Will Everything go as planned??

For two to three weeks I have not meet any of my friends and we are planning for a get together during the upcoming weekend. Many of them are happy because they have got their Date of joining on the mid of November, so we all are planning to meet before they move to Ahmedabad for training, whereas some of my friends are still worried about their deferring date of joining and they have not got any intimation from the organization that took them in Off campus. So there is a conflict that needs to be resolved among them and hope that we get solved it as soon as possible and ensure that everything goes as the plan. Hope that the upcoming weekend would be interesting to me and surely I will share my views with you.

Sunday, November 2, 2008

Get your Stylish Fames Today


If you think that stylish glasses comes at costly rates then you are wrong, here is Zenni Optical which provides you Great Eyeglasses For Less amount, the reason behind this is they sell their manufactured frames directly to the customers without any intervention from the third party. You can choose the Variable Dimension Frames From Zenni that you like and the above picture shows my favorite one. It even became much popular when Zenni Optical was on FOX news! for manufacturing wide range of frame styles and quality products. The Zenni on fox news has made a great deal revealing the popularity and quality of Zenni Optical and order your favorite eyeglass today.

Saturday, November 1, 2008

Hectic week approaching...

The rain was troubling me much last month, because of it I had to delay every jobs of mine. I even failed to attend two of my classes at AU PERS center. Those two classes covered array of pointers and structures, It was bad that I missed the classes on array of pointers which was an interesting and tough topic. However I hope I could get my doubts cleared on it. The upcoming week I have one week practicals and I have to complete twenty programs within this week and get it signed from the lab incharge. The twenty programs seems to be pretty tough and time consuming I tried to complete only three and it took me two hours and I spent most of my brain work there, now trying to get some relaxation. Hope that I could complete the programs on time and I also have to prepare for the test after this week on C module. I hope that this week is a hectic one and I have to plan well to face it.