lua array into c++ array

Viewed 633
 local pricetagColors = {
    [3242] = {255, 0, 255},
    [6712] = {255, 255, 0}
 }

 function getPricetagColor(itemnumber)
    local r, g, b = 0, 0, 0

    if pricetagColors[itemnumber] then
        r, g, b = pricetagColors[itemnumber][1], pricetagColors[itemnumber][2], pricetagColors[itemnumber[3]
    end

    return {r, g, b}
 end

Alright, so I am trying to get into C++ right now step by step. Right now I am trying to figure out how (complicated?) arrays in C++ are created. As I have no idea how to explain it in another way, I did it in LUA as that is what I know best. The function is not the important thing, the important thing is the array because I have searched around for a few hours now but I can not figure out how to get the array you see in lua done in C++.

2 Answers
Related