For loop Issue
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: For loop Issue

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    For loop Issue

    Hi im currently pursuing engineering and im learning C sharp as it was widely used for framework projects...
    Im trying to write a program and im stuck with the following:-

    scenario:
    byte msg[]
    for(i=0;i<12;i++)
    {
    string msg1;
    msg1= msg[i].ToString();
    Assert.Areequal("some statement",the message is,msg1,0)
    }

    The output is coming like this:-
    0
    0
    0
    1
    0
    0
    0
    0
    12
    32
    24
    255


    i.e im reading every byte of the message i.e there are totally twelve bytes..
    i need to get every byte mentioned above in multiple strings for eg byte 1 in msg1 , byte 2 in msg2 , byte 3 in msg3 like that..but i cant able to get the bytes..for eg if i need to get the byte 1 alone to be printed i cant figure out to do that..Please guide me..thanks.......
    PS :- similarly whether it is possible to print the complete message together for eg 00010000123224255 in a single instance

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,230

    Re: For loop Issue

    That doesn't appear to be Visual C++ code as it's discussed in this forum. Go to the managed C++ forum and post complete code.

  3. #3
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,854

    Re: For loop Issue

    Hi im currently pursuing engineering and im learning C sharp
    This is c# code - not c++ !! You need the dedicated c# forum. Can moderator move this post please?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center