prova

by santoprova on July 21st, 2010
No notes
Syntax: No syntax
Show lines - Hide lines - Show in textbox - Download
int generaInitVect(){
 
    int x;
    int ran;
    srand(time(NULL));
    for (x=0;x<10;x++){
 
        ran= rand() % 256;
 
 
        initVect[x]=(char) ran ;
 
        printf("ran= %i **%c**\n",x+200, (char)x+200); //anche questo è per vedere quali char genera dagli stessi int usati sotto (non randomici)
    }
 
}
 
 
Private Function NewInitVector() As String
    Dim iRandomInteger As Integer 
    Dim sVectorString As String
    Dim i As Integer 
 
    Const iLowerBound = 0
    Const iUpperBound = 255
    Const iVectorLength = 10
 
    Randomize
 
    For i = 1 To iVectorLength
        iRandomInteger = Int((iUpperBound - iLowerBound + 1) * Rnd + iLowerBound)
        Me.Text3.Text = Me.Text3.Text & vbCrLf & i + 200 & "**" & Chr(i + 200) & "**" '' questo è solo per vedere che minkia di caratteri genera
        sVectorString = sVectorString & Chr(iRandomInteger)
    Next
 
    NewInitVector = sVectorString
 
End Function

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS