Creating associate array

In reply to shashikanth123:

module top;
  int S[] = {1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 3, 1, 100, 555};
  int A[int] = '{default:0};
  initial begin
    foreach(S[i]) A[S[i]]++;
    $display("A = %p",A);
  end
endmodule