0

I have following data table :

enter image description here

And I want to organize it in C data structure ,and accessing by :

Example :

#define TRUE 1
#define FALSE 0
printf("%d",arr["Peter"]["Read"]) ; //1 
printf("%d",arr["Jonathan"]["Execute"]) ; //0

or modify it :

arr["Marry"]["Write"] = TRUE ;

Is this impossible in C ?

.//Update I think it's difference from this question because my question about accessing value via 2 key

Community
  • 1
  • 1
Ryo
  • 995
  • 2
  • 25
  • 41
  • 2
    an array of a structure with 2-D array. – Sourav Ghosh Oct 02 '15 at 09:09
  • and some `#define`s. – Sourav Ghosh Oct 02 '15 at 09:12
  • 1
    Why a `struct`? @SouravGhosh – alk Oct 02 '15 at 09:18
  • 4
    It really doesn't make sense to make up a syntax and then ask if you can coerce the language into making it work. It's equivalent to saying, "I want to say 'myxlypik moonlop' and have it mean something in English." Sure, you could probably find some way to make those exact things mean something in that language, but WHY? That's not how you use a language. You decide what you want to say, then you figure out how to say it in the language. – David Schwartz Oct 02 '15 at 09:18
  • @alk Just to have a user-defined data type, later if we want to expand, in that case, it can come handy. :) – Sourav Ghosh Oct 02 '15 at 09:19

0 Answers0