質問

I am trying to store data from a CSV file and ran into an access violation. The first image was shows how the memory is allocated, the second shows the problem area and the third is the spot in the csv where the problem occurred. Any help is appreciated.

enter image description here snip of my VS

data at problem location

役に立ちましたか?

解決

It looks like the first loop that does the "pre-allocation" may have an error. The following allocation:

AllCurrentData[newLineCOunt].data = malloc(COLUMNS * sizeof(char));

should, I believe, be this:

AllCurrentData[newLineCOunt].data = malloc(COLUMNS * sizeof(char*));
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top