|
++a is the prefix incrementor
a++ is the postfix incrementor
if a = 5 then ++a returns 6 and a becomes 6
if a = 5 then a++ returns 5 and a becomes 6
therefore
b = ++a + ++a
= 6 + 7
= 13
|
|
|
|
|
You are correct and this is what i got with c# as well, but c++ gave me 14.
|
|
|
|
|
I have read this statement in a book.
"The results of expressions which use same variables with increment operators more than once are unpredicatble in C Language"
int i=0;
i=i++ + ++i; //3 not 2
-----------------
int i=0,j=0;
j=i++ + ++i; //2 as esxpected
You can try with lot of examples...
Regards,
Arun Kumar.A
|
|
|
|
|
It would indeed seem that way. If I do the following in c++ I do get the expected result
int a;
int b;
a = 5;
b = ++a;
b += ++a;
|
|
|
|
|
Try to use the variable 'a' more than once(with increment/decrement operator) in a single expression and assign the result to 'a' itself.
You will get unexpected results.
Regards,
Arun Kumar.A
|
|
|
|
|
However. It's strange, C++ gives 14 at the same time C# gives 13.
The different interpretation of statements?
A
|
|
|
|
|
In C++ this expression results in undefined behavior. Look
here[^] for details.
Regards,
Tim
|
|
|
|
|
I tried the following code to check "Allow Interact with desktop" of the Log on Property of my service using the following code but it is not working, but that option is checked. If I Uncheck and check it manually it is interacting with the desktop. Why????????
I tried this code in ServiceInstaller_AfterInstall,ServiceInstaller_BeforeInstall,OnStart()of the service and Service Class Constructor
--CODE--
Microsoft.Win32.RegistryKey ckey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\Sample_Service", true);
if (ckey != null)
{
if (ckey.GetValue("Type") != null)
{
ckey.SetValue("Type", ((int)ckey.GetValue("Type") | 256));
}
}
--CODE--
Please Help Me
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
How can i send sms from my application to any mobile device.
How to achieve this???
reply soon
Regards,
|
|
|
|
|
Hi,
try the article search for "sms", there are lots of articles on cp about this topic.
|
|
|
|
|
Hi,
You need to use a Mobile Phone manufacrture's library. Using that you can send sms to from your application. These libraries have very simple interface.
There are two way to send the sms using these libraries.
1) Using a mobile handset
2) Using a getway.
One such library I do remeber is from Nokia.
Manoj
Never Gives up
|
|
|
|
|
Hi,
Can anyone have idea about how can i get a sub(small) dataTable from a huge dataTable?
datatable.select() returns only datarows that is time consuming in case of huge database. I want a fast method.......
Thanks
Syed Shahid Hussain
|
|
|
|
|
I don't know if this is the best way but I usually go back to the database to return any 'sub' data. For me this has always been the fastest method and would do this unless I need to limit network traffic for some reason.
|
|
|
|
|
Query in 30,000 for 10 times in 1 min is simply killing the aplication....
I want any System mechanism to solve my problem.
Syed Shahid Hussain
|
|
|
|
|
make a view of your table
use dataview class
to do that
|
|
|
|
|
Thanks Nauman Brother,
I'll check it in morning and then inform you about my progress.
Syed Shahid Hussain
|
|
|
|
|
Asalam-o-Alikum Dear Brother,
Really thanks for your hint. It has solved my big problem. Thanks
Allah Bless You with success.
Syed Shahid Hussain
|
|
|
|
|
plzzz - i need some help on how to record windows explorer events like file create, copy, delete, rename in VISTA using .NET. Application needs to track the user operations in windows explorer. PLZ HELP
Raj
|
|
|
|
|
Hi,
maybe the FileSystemWatcher element from the Toolbox can help you to solve your problem.
|
|
|
|
|
Thanx a lot for the feedback. i will look into it
|
|
|
|
|
I might be missing something here but i did something along these lines with the FileSystemWatcher class in the System.IO namespace. I made it watch the C:\ drive and then I just hooked up it's events so that is would write out the name(path) of the file in question and the event that was taking place along with the time to a text file. However this was on XP and i'm not sure what the difference is with VISTA.
enjoy
|
|
|
|
|
I managed to get more info on the same. thx a lot friend. but i am still looking on how to use it for an entire system (all the drives) . . . any ideas ??
|
|
|
|
|
i have a drop down in the grid view after a new row
i want to change the selection of drop down but i get the following error in my browser Failed to load viewstate i am using data table for binding what is the solution
|
|
|
|
|
Dear All
Regards!
Its me David,
I download drawtools from
http://www.codeproject.com/csharp/drawtools.asp
the above tool reading only dtl file.
but i need the above type or any other along with the same functions but read DXF file and then draw it, and after drawing i have the functions to edit it.
hope for + response,.
David
-- modified at 1:10 Tuesday 29th May, 2007
david
|
|
|
|
|
Oh, it's you, David! Almost didn't spot you under 4 million members...
Anyway, there are several articles here presenting Undo/Redo frameworks, for example this here[^].
If you still have problems with applying the undo pattern on the objects the drawing tools program uses you could ask your questions in the article's discussion - the original author will be notified that there's a new question regarding his article.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|