473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

regarding storage classes in C

Hello All,
how are you?

Can you please make me aware of storage specifiers like volatile, extern, and register ? I know the in what situations they can be used. But till this date I haven't seen any practical example using volatile or register.

can you please let me know ?

Thank you in advance,
Sanket
Feb 24 '08 #1
4 1462
sicarie
4,677 Expert Mod 4TB
As this smells suspiciously of homework, I'm going to ask, what do you think are practical examples?
Feb 24 '08 #2
As this smells suspiciously of homework, I'm going to ask, what do you think are practical examples?
Hello sicarie,

This is not a homework question. Actually I am done with my graduation already. And I have also got some field experience too. I have started revising C so I can look at things from different perspective.

I read that by keeping your variable volatile any other process can change it. But I haven't come across such situation. So I was wondering where and how such storage specifiers are used.

Thank you
Feb 24 '08 #3
sicarie
4,677 Expert Mod 4TB
Cool.

So can you think of any cases where that might be practical?
Feb 24 '08 #4
Cool.

So can you think of any cases where that might be practical?
Yes .. There are some .....
For example, there are two programs which are using the same resource, it could be a file, some shared area of memory or anything. But What I am not getting is ..... why do we need to keep it volatile ? I havent seen this keyword in any code I have come across. Does this have some relation to access protection mechanism of Operating System ? I am not getting any concrete solution to this.

Thank you,
Sanket
Feb 25 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rune Lanton | last post by:
Hello! I am developing an application for PPC2003, and I want too put my SQL CE db on a flash card. But I'm a little concerned about flash lifetime! Most flash memory have a limit of 100.000...
5
by: aneesh | last post by:
Hi all, I have a program, this works fine but if we declare static below "int i" it shows different storage class specifier. what will be the reason. #include <stdlib.h> static int i ; int...
9
by: niclane | last post by:
Hi, I was reading section 5.5 of Ritchie and Kernighan and saw the following: " ..... char amessage = "now is the time"; char *pmessage = "now is the time";
77
by: M.B | last post by:
Guys, Need some of your opinion on an oft beaten track We have an option of using "goto" in C language, but most testbooks (even K&R) advice against use of it. My personal experience was that...
13
by: Vijay | last post by:
Hi All, I am learning C++ and have one question. Using free or delete we can release the memory. After releasing memory where this released memory will go.. Does it go to back operating...
1
by: pratap | last post by:
consider this code snippet #include<iostream> using namespace std; class A { void func() { }
2
by: e2point | last post by:
i need to create a storage module which can store any thing the user wants. I want it to handle almost any storage requirement, so that clients can define their own key classes derived from the...
2
by: sumsin | last post by:
are 'mutable' and 'volatile' a Storage Classes in C++?
16
by: Joe Strout | last post by:
One thing I miss as I move from REALbasic to Python is the ability to have static storage within a method -- i.e. storage that is persistent between calls, but not visible outside the method. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.