It's UWAweek 30 (2nd semester, week 1)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 1168 articles.
Currently no other people reading this forum.


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported

Login to reply

👍?
helpful
5:22am Wed 11th Oct, Christopher M.

ANONYMOUS wrote:
> How would I go about adding a relative path to a hashtable without introducing a Segmentation Fault? > > Currently, I am able to add directory entries such as program.c, a.x etc to a hashmap and modify them according to modification times but I require some help with adding relative pathnames > > For example, subdir1/program.c which has the full pathname dir1/subdir1/program.c > > When I attempt to use add_hashtable which is basically the same as the one in lectures I encounter a Segmentation Fault and I am not sure how to diagnose the cause.
There are many different ways to implement hashtables, and all sorts of information may be used as their keys, and stored in them. The example code provided in our workshop is just one example, but should be able to store all values/lengths of strings. If you have modified the provided code - permitted, and probably necessary - and it now crashes, then we can't diagnose the problem. However, the way you've framed the situation is akin to stating "I have a data-structure which stores integers; it works most of the time, except when I attempt to store prime integers". For our project, file and (sub)directory names are all just strings, and if certain strings crash your program, the problem is very likely in the implementation of the data-structure, and not due to the type/value of what you're trying to store.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  7:24AM Jul 25 2024
Privacy policy