Search 5,000,000+ questions and answers.

Frequently Asked Questions

Why must I use a cast to convert from void*?

Stroustrup: C++ Style and Technique FAQ
In C, you can implicitly convert a void* to a T*. This is unsafe. Consider: #include<stdio.h> int main() { char i = 0; char j = 0; char* p = &i; void* q = p; int* pp = q; /* unsafe, legal C, not C++ */ printf("%d %d\n",i,j); *pp = -1; /* overwrite memory starting at &i */ printf("%d %d\n",i,j); } The effects of using a T* that doesn't point to a T can be disastrous. Consequently, in C++, to get a T* from a void* you need an explicit cast.
Related Questions

Can I convert a pointer-to-function to a void*?

Pointers to member functions, C++ FAQ Lite
Please do not email me if the above seems to work on your particular version of your particular compiler on your particular operating system. I don't care. It's illegal, period.
Related Questions

Sometimes another player "is cast into the void". What does that mean?

Genesis - Frequently Asked Question
When a player goes 'link dead' or loses his/her connection to the game, the player is 'cast into the void'. That is a place where he/she is safe until he/she regains his/her connection. He will then appear at the same location.
Related Questions

How do I convert my site to use eZcart?

FAQ - TotalyZer ezCart
Converting standard HTML pages from Paypal to eZcart is simple. Just substitute the URL for eZcart in place of the URL for Paypal in each of the 'add to cart' forms on your web site. Here is an example: substitute http://www.yoursite.com/eZcart/ezcart.php instead of https://www.paypal.com/cgi-bin/webscr You must also edit each 'add to cart' form to contain the shipping weight of the item. Do this by adding one of the following.
Related Questions

What is a cast?

Children's Orthopaedics
A cast is a rigid casing wrapped around a broken bone to keep it from moving while it heals. The cast must remain in place until the doctor removes it. If the cast is broken or damaged, the bone might not heal properly. Swelling sometimes occurs when a bone is broken; it can be helped by elevating the affected limb.
Related Questions

Can I convert a pointer-to-member-function to a void*?

Pointers to member functions, C++ FAQ Lite
Please do not email me if the above seems to work on your particular version of your particular compiler on your particular operating system. I don't care. It's illegal, period.
Related Questions

I came across some code that puts a (void) cast before each call to printf. Why?

printf does return a value (the number of characters printed, or an error code), though few programs bother to check the return values from each call. Since some compilers (and lint) will warn about discarded return values, an explicit cast to (void) is a way of saying ''Yes, I've decided to ignore the return value from this call, but please continue to warn me about other (perhaps inadvertently) ignored return values.
Related Questions

Will the use of TonerTopUp void my warranty?

Save up to 87%. Refill your laser printer, copier or fax ton...
No! In most countries, it is against the law to tie the purchase or use of a particular supply to the warranty. You may like to check this out by looking at what Hewlett-Packard, the market leaders, have to say about it at: Sorry this page seems to have been withdrawn! However HP confirm that this is still the current position (July 2005). They make the point that maintenance agreements are normally contracted with their partners and not direct to HP.
Related Questions

Should I use f(void) or f()?

Newbie Questions / Answers Updated! , C++ FAQ Lite
C programmers often use f(void) when declaring a function that takes no parameters, however in C++ that is considered bad style. In fact, the f(void) style has been called an "abomination" by Bjarne Stroustrup, the creator of C++, Dennis Ritchie, the co-creator of C, and Doug McIlroy, head of the research department where Unix was born. If you're writing C++ code, you should use f(). The f(void) style is legal in C++, but only to make it easier to compile C code.
Related Questions

How do I use convert?

Frequently Asked Questions @ joshmadison.com
Convert is very easy to use. You simply select the tab of the category you want, select the input unit, select the output unit, and type in the input value. Convert shows you the conversion result in the output box as you type.
Related Questions

US to UK Moving FAQ
To have a US item run under UK current you need to buy a transformer, a product that you plug into the wall and has a US-style jack at the other end. The transformer will "step down" in voltage from 240 to 120v. From there you may want to plug in a US-style power strip and provide current for sev eral products. Next you need to consider how many watts your transformer is providing (all transformers should clearly indicate this).
Related Questions

In a call to malloc, what does an error like ''Cannot convert 'void *' to 'int *''' mean?

Memory Allocation
It's never necessary to multiply by sizeof(char), since sizeof(char) is, by definition, exactly 1. (On the other hand, multiplying by sizeof(char) doesn't hurt, and in some circumstances may help by introducing a size_t into the expression; see question 7.15.) See also questions 8.9 and 8.10. I wrote a little wrapper around malloc, but it doesn't work: #include <stdio.h> #include <stdlib.
Related Questions

I use a Mac; will I still be able to attend the Web Cast?

CSIS SI Faq
Yes, you will still be able to attend the Web Cast; however you will need to set up your computer prior to the training. To do this, follow these steps:
Related Questions

Can I use Le Creuset cast iron in the oven?

Le Creuset - FAQ
Yes. Pans with metal or heat resistant phenolic knobs/handles may be used in the oven. Phenolic knobs/handles are oven safe up to temperatures of 375°F.
Related Questions

How do I use a wand to cast spells?

Bard Woodcrafts: FAQ
for how to use the wand, there are many schools of thought there, and indeed it is something you should develop as you go. The traditional "swish and flick" of Harry Potter is a lovely movement that symbolizes the release of energy in a particular direction.
Related Questions

Why use cast limestone for mantels?

American Cast Limestone FAQ Page
Since the mantel is the focal point of a room, and often viewed very closely, it makes sense to choose a stone that has great natural beauty and requires no further finishing or maintenance.
Related Questions

How do I convert my site to use ZonaCart?

FAQ - ZonaCart
Converting standard HTML pages from Paypal to ZonaCart is simple. Just substitute the URL for ZonaCart in place of the URL for Paypal in each of the 'add to cart' forms on your web site. Here is an example: substitute http://zonacart.com/usr/ZZZZ/cart.php You must also edit each 'add to cart' form to contain the shipping weight of the item. Do this by adding one of the following.
Related Questions

How do I take care of the cast?

Children's Orthopaedics
Make certain your child DOES NOT put any objects down the cast. If your child experiences itching, tell your doctor.
Related Questions

What is a Spica cast?

Children's Orthopaedics
A cast which includes the trunk of the body and one or more limbs is called a Spica cast, just as a cast which includes the "trunk" of the arm and one or more fingers or the thumb is. For example, a shoulder spica includes the trunk of the body and one arm, usually to the wrist or hand. Shoulder spicas are almost never seen today, having been replaced with specialized splints and slings which allow early mobility of the injury so as to avoid joint stiffness after healing.
Related Questions

Can I use MacroBins for fermentation? Will this void my warranty?

FAQ
Yes, MacroBins can be used for fermentation. If used correctly, this process will not void your warranty.
Related Questions

Will my vehicle warranty be void if I use Combusto ?

Fuel Additives - Frequency Asked
No, as a few drops of Combusto function only at electro-statics level and there is no change of state of matter to your fuel. Combusto cannot be traced nor detected in your fuel, in physical or chemical state as 98.5% is octane95, similar to any other fuel.
Related Questions

Should I use void main() or int main()?

Newbie Questions / Answers Updated! , C++ FAQ Lite
Some compilers accept void main(), but that is non-standard and shouldn't be used. Instead use int main().
Related Questions

How do I convert my MP3 files to be playable on my V CAST Music phone?

Answers to FAQS
Using V CAST Music Manager or Windows Media Player 10 (or higher) and the appropriate USB cable and software drivers, you can sync your MP3 files to the V CAST Music phone. During the sync process, MP3 files will automatically be transcoded, if necessary, to the WMA format that you can play on your V CAST Music phone. The original MP3 files on your PC will remain in the MP3 format. If you have MP3 files on a phone memory card, simply save them to your PC and then convert them as above.
Related Questions

What are some of the lines cast members use?

DisneyFans.com: Haunted Mansion FAQ
You will note, at least at TMK, the cast member name badges often have home towns such as "Tombstone, AZ" and sometimes even the names are more "show" than, likely, real.
Related Questions

Where can I use V CAST Music?

Answers to FAQS
Certain features of the service require you to be in the V CAST coverage area; some features are not dependent the V CAST coverage area you are in. View Coverage areas.
Related Questions

When should I use a cast aluminium roof outlet?

Alumasc
Cast aluminium outlets may be used with most roof coverings, including bituminous and single ply membranes.
Related Questions

What cast net mesh size should I use?

BLACK PEARL Cast Nets- FAQ
There is one main reason that will make this decision for you.
Related Questions

Got A Question? Ask Our Community!


More Questions >>

© Copyright 2007-2008 QueryCAT
About • Webmasters • Contact