RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: Associative Array-String index
Prev Next
You are not authorized to post a reply.

Author Messages
Nithin KumarUser is Offline

Posts:4

12/07/2009 12:16 AM  
Hi all,
I'm new with SystemVerilog and need your help.
When i run the following code output is coming in a different what i expected.

module asso_str_str;
string str[string]='{"sachin":"one","dravid":"two","ganguly":"three"};
string s ;

initial begin
foreach (str[s])
$display("string = %s and rank =%s",s,str[s]);
#10 $finish;
end
endmodule

Output is coming like this:
string = dravid and rank =two
string = ganguly and rank =three
string = sachin and rank =one

Can any body explain the the cause for this.Please let me know the cause.!!


Thanks,
Nithin
You are not authorized to post a reply.
Forums > SVUG Archive > Archive > Associative Array-String index



ActiveForums 3.7
  

 Copyright 2008 by SystemVerilog User Group Contact Us    Privacy Statement