Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for wasIzy‭

Type On... Excerpt Status Date
Comment Post #293256 Stand-alone 2D array on the heap and a pointer in `basket` ...doing that now! Thanks for dragging me away from my obsession with squeezing a 2D declaration into the struct.
(more)
about 8 hours ago
Comment Post #293246 The data in the basket(s) is ALL from user-provided .txt files. The files are parsed, impossible data filtered out, and residual fed to the basket(s). From that moment (±0.02sec into the run) the basket(s) do not change: no edits; no realloc; NO flexibility. "...accept that the data is stored else...
(more)
about 8 hours ago
Comment Post #293247 Thanks @celtschk for your suggestion: essentially a lookup-table into a (renamed) `char *items`. It would work, BUT Ignoring the inevitable memory inflation (237% in a simple test-case), the array-of-pointers look-up is not fast! Speed is a concern since the code must look (and re-look) millions of t...
(more)
about 15 hours ago
Edit Post #293246 Post edited:
1 day ago
Comment Post #293246 Data are values that fit comfortably in a char, NOT strings. They may match a "dictionary word" in some language, but are NEVER used in any string-like context (string.h, printf...%s, etc). Execution speed is important: the code will access `baskets[]` millions of times in a run, how many millions...
(more)
1 day ago
Edit Post #293246 Initial revision 2 days ago
Question 2D-array pointer as a struct member
I have an array of struct: ``` static struct basket baskets[MAXITEMLEN + 1]; struct basket { char items; // malloc(itemlen itemcount) int itemcount; }; ``` `char items` does all I need to do with some pointer-gymnastics, but at times it gets a little ugly. I would prefer a 2D...
(more)
2 days ago