Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

Stack versus Heap

$
0
0
1) Variable in Call Procedure are going on Stack

Code:

Private Sub OnStack

    Call AnotherProc(10, "test)                  << Since Call is part of procedure, Call Parameters are copied to the Stack

End Sub

[


////////////////////////

Where do variables assigned in local procedure to global type reside??
How can one verify this in VB?

[
Code:

  Type TOnHeapInfo
        i  As Integer
        s  As String
End Type

Public Type TOnHeap As TOnHeapInfo

Private Sub OnHeap

Are locally assiged variables going to Stack or HEAP when the variables are assigned to global Type?
      With TOnHeap
        .i = 10
        .s = "test"
      End With

 
End Sub

[


Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>