Assign new value to an object in a function
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 11 of 11

Thread: Assign new value to an object in a function

Threaded View

  1. #1
    Join Date
    Oct 2004
    Ho Chi Minh, Vietnam

    Assign new value to an object in a function

    I want to pass an object to another function (of another class) to assign new value to it: code below
    public class MyClass
    		InfoSupplier infosupplier;
    		public void myFunc(){
    			Info infocarrier = new Info();; //infosupplier has already been declared and allocated elsewhere
    			//the problem is after this line, infocarrier still doesn't have the new values (members)
    			//which means the assignment inside the function supply() is NOT effective
    	public class InfoSupplier
    		Info info; 
    		public void supply (Info ic)
    			ic = ;// has been declared and allocated, assigned value elsewhere
    What is wrong with the assignment? Given everything in Java is pointer
    Last edited by choconlangthang; August 8th, 2010 at 05:08 AM. Reason: missing the question :)

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 survey!

HTML5 Development Center