![]() ![]() ![]() ![]() Next: Convenience Routines Up: Key/Value Tables Previous: Arrays as Table Values Contents Character Strings
One very common thing you might want to store in a table is a
character string. While you could do this by explicitly storing
an array of if (Util_TableSetString(handle, "black holes are fun", "bh") < 0) CCTK_WARN(CCTK_WARN_ABORT, "couldn't set string value in table!"); ... char buffer[50]; if (Util_TableGetString(handle, 50, buffer, "bh") < 0) CCTK_WARN(CCTK_WARN_ABORT, "couldn't get string value from table!"); /* now buffer[] contains the string "black holes are fun" */
|