473,800 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

register variable

Hello folks

I often use register variables within functions (or as funcion parameters)
that reauired speed like searching for example . I know that it doesn't
mean that every register variable will be holded in register

so is there any rules to precize when using them
thanks

Nov 14 '05
14 1926
Sorry teacher :)
I meant by ie: ? (For example)
A coherent example that shows the use of a register variable
did u anderstand ?

Nov 14 '05 #11
On Thu, 06 May 2004 09:22:03 -0400, in comp.lang.c , "macluvitch "
<ma********@hot mail.com> wrote:
Sorry teacher :)
I meant by ie: ? (For example)
A coherent example that shows the use of a register variable
Perhaps there isn't one, in these days of optimising compilers.
did u anderstand ?


if you wrote in less opaque english, people might find it easier to
understand. For instance and stating what you want instead of using
abbreviations and hoping everyone can read your mind. I'm not being funny,
but most people here have busy lives and don't have time to second-guess
the true intentions of newbies.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #12
macluvitch said the following, on 05/06/04 09:22:
Sorry teacher :)
I meant by ie: ? (For example)
A coherent example that shows the use of a register variable
did u anderstand ?


Well, you are writing not only cryptically, but also incorrectly. The
abbreviation, "i.e.", is for Latin "id est", or "that is" in English.

The equivalent "for example" abbreviation is "e.g.", for Latin "exempli
gratia" (for [the sake of] example).

If you want someone to answer your questions, it is in your interest not
to write in riddles. Besides, how difficult is it to write, "Could you
please give an example?"
--
Rich Gibbs
rg****@his.com
Nov 14 '05 #13
"macluvitch " <ma********@hot mail.com> writes:
Sorry teacher :)
I meant by ie: ? (For example)
A coherent example that shows the use of a register variable
did u anderstand ?


This was in response to something posted about 4 days ago. You can't
reasonably expect us to remember the context. It's seldom necessary
to quote the entire article to which you're responding (unless it's
fairly short), but it's very helpful to provide *some* context.

(Incidentally, "i.e." means "that is" (Latin "id est"); "e.g." means
"for example" (Latin "exempli gratia").)

This is an international forum. We do use some jargon here, but
you'll find it much easier to communicate if you write in complete
words and complete sentences. The use of 'u' rather than 'you' is
particularly frowned upon, for reasons I won't get into.

In response to what I think your actual question was, there's probably
no good use these days for register variables. The original intent of
the "register" keyword was to provide a hint to the compiler that a
given variable is going to be used heavily, and that it would be
beneficial to store it in a CPU register rather than in main memory
(and that its address will never be taken). Modern compilers are
likely to be able to figure this out for themselves; you'll get a much
better performance improvement by adding "-O3" or equivalent to your
compiler's command line than by tweaking the source. The common
wisdom is that adding "register" keywords is more likely to hinder the
compiler's optimization than to help it; I don't know how accurate
that is.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 14 '05 #14
since this moment I'll write
Thank you all folks rather than this cryptic one
Tanq u AlL Fallcks :)

Sorry for all troubles here
Nov 14 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2255
by: Ioannis Vranos | last post by:
Just some thought on it, wanting to see any explanations. It was advised in this newsgroups that we should avoid the use of keyword register. However it is a language feature, and if it offers no help to an implementation, it is free to ignore it. And this happens widely, all my C++ compilers in my platform ignore this keyword.
10
15663
by: ajay | last post by:
some say floats can't be stored in register. size of int and float are same ( on some machine am i Wrong?) so if int can be delcared as register than why not float(where in and float are of same size) ? tx Ajay
13
6211
by: Shankar Agarwal | last post by:
I was trying to use a variable whose value is temporary and i don't want it to go to the memory for performance reasons. Is there a way to specify the variable like that so that any assignment to the variable does not go to memory. I tried the type register but it does not seem to work. Thanks Shankar
14
7916
by: aruna | last post by:
What is the disadvantage of using register storage class specifier?
9
8612
by: Jackie | last post by:
Hi everyone, Does anyone know when "register" declarations should be used and when "register" must not be used? If possible please give examples for both cases. Thanks
16
2467
by: junky_fellow | last post by:
what is the purpose of declaring a register variable ? why can't we find the address of register variable ?
4
1455
by: sanchana | last post by:
how can i check whether a register variable is assigned to a register only or not
29
2481
by: orium69 | last post by:
hi everyone, i'm wondering if there is a way to have sure that a variable is allocated in the cache, after its declaration with "register"? Tks!
7
5168
by: int main(void) | last post by:
Hi all, I know that register variables work fine at block scope. I tried putting a register variable in file scope, like this, #include <stdio.h> register int a = 2; int main(void) { printf("%d\n",a);
26
2232
by: Vashna | last post by:
Hi Group, I have a doubt about register variables. I know that if we have a variable used very frequently in a function, then provided we never apply the & function to it, we can define it as a register variable and this will make it much faster to access. Now the question is: obviously there are only a fixed number of registers in our CPU, maybe 6 or something. So how do we choose which
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.