User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 403,516 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,853 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 624 | Replies: 2
Reply
Join Date: Jun 2008
Posts: 11
Reputation: jack1234 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jack1234 jack1234 is offline Offline
Newbie Poster

CLR Console application vs Win32 Console application

  #1  
Jul 5th, 2008
I am using Visual Studio 2005.

Following two programs has the same code, just that one is CLR Console application and the other is Win32 Console application.

I set a break point at int i=1 for both program, for CLR Console application, and when run to the break point, in the local windows,
I have seen none of the value set for the array beans;but for Win32 Console application, the value has been set correctly.

What is the reason for this different?
====CLR Console application====
#include "stdafx.h"

int main(array<System::String ^> ^args)
{
      double beans[3][4];
      beans[0][0] = 0;
      beans[0][1] = 1;
      beans[0][2] = 2;
      beans[0][3] = 3;
      beans[1][0] = 10;
      beans[1][1] = 11;
      beans[1][2] = 12;
      beans[1][3] = 13;
      beans[2][0] = 20;
      beans[2][1] = 21;
      beans[2][2] = 22;
      beans[2][3] = 23;
      double (*pbeans) [4] =beans;
      pbeans++;
      int i=1;
}
====CLR Console application End====


===Win32 Console application=====

int main(){
      double beans[3][4];
      beans[0][0] = 0;
      beans[0][1] = 1;
      beans[0][2] = 2;
      beans[0][3] = 3;
      beans[1][0] = 10;
      beans[1][1] = 11;
      beans[1][2] = 12;
      beans[1][3] = 13;
      beans[2][0] = 20;
      beans[2][1] = 21;
      beans[2][2] = 22;
      beans[2][3] = 23;
      double (*pbeans) [4] =beans;
      pbeans++;
      int i=1;
}
===Win32 Console application End=====

This is what I see for CLR Console App when debugging
http://tinyurl.com/5jq4yb
This is what I see for Win32 Console App when debugging
http://tinyurl.com/69xzmb

I am using debug configuration, and
is what appeared in Projects>TestCLR Properties>Configuration Properties>Command Line
/Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\TestCLR.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"
under Active(Debug) configuration.
Last edited by Ancient Dragon : Jul 5th, 2008 at 7:25 am. Reason: replaced quote with code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,745
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 884
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: CLR Console application vs Win32 Console application

  #2  
Jul 5th, 2008
Maybe its a compiler debugger bug -- I used VC++ 2008 Express and the CLR version displays the values the same way your link shows for the win32 console program.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Jun 2008
Posts: 11
Reputation: jack1234 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
jack1234 jack1234 is offline Offline
Newbie Poster

Re: CLR Console application vs Win32 Console application

  #3  
Jul 5th, 2008
Hi Ancient Dragon,
I have updated my VS to Service Pack 1, now CLR Application Console looks normal again!
As you have mentioned, the problem may related to VS debugger itself.
Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 1:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC