Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
any way to chane the val of const ??
Name: Adnan Date: March 9, 2002 at 07:57:07 Pacific
Comment:
hi is there any way to change the value of a constant integer in c++;
constant int a=10;
i need to chande its value is there any algotithm?
Name: dale Date: March 9, 2002 at 08:56:39 Pacific
Reply:
not that i know of, but there may be...seems to me it wouldn't be a constant then though..... :P Maybe if you can say why you want to change it, we can help you think of some kind of workaround -Dale
0
Response Number 2
Name: Mr. A Date: March 9, 2002 at 13:56:24 Pacific
Reply:
In some implemantations of C you can. You can do it in Borland C/C++ 3.1. When I use FreeBSD/GNU 2.7.2 it knows it's a constant and won't let you do it.
The way to do it in Borland is to take the address of the constant, cast it as a pointer to the constant (which it is) and dereference it.
Summary: hey guys..in qbasic i'm wondering..well i'm going crazy trying to figure out how to find the sum of a 4 digit code...example 1111 =4 1234 = 10 i dont want to assign each digit a variable like print"...
Summary: Is there any way to use the dir command / some DOS Script to select only first file of similar pattern of files in a direcotory and rename it for example, one directory has 5 files abc_1005.txt abc_5...