#Segmentation Fault Error

43 messages · Page 1 of 1 (latest)

wooden glacierBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

urban geyser
#

share your code

#

@urban geyser please share your code

shrewd moon
#

are you using character anywhere?

#

but after you scan it you don't use it do u

#

if so you could use %*c, it reads it but doesn't store anywhere

#

I don't think it's the cause though

urban geyser
#

after int first_num = fscanf(f, "%79[^|]|", courses);?

shrewd moon
#

id use debugger + address sanitizer

urban geyser
#

i see, show a few first lines of content for input file

#

pattern maybe incorrect, i think

shrewd moon
#

u on windows or linux

urban geyser
#

sure

#

input is course_name|?prerequisite1?prerequisite2...?prerequisiteN|course_type|credit_hours

#

@urban geyser why did you use %79[^|]| pattern?

#

that's mistake

#

do you want help or want to try by yourself

#

?

#

the mistake resides in pattern

#

sorry, I have meeting now for 30 mins

#

I will back then

urban geyser
#

I am back

#

use %*[^|] or %[^|]

#

then let me know the result

#

right

#

if then

#

use %s to get whole line

#

and use strtok for splitting

#

using pattern has several problems according to compiler

#

which compiler are you using?

#

anydesk

#

As I don't have compiler, I should try on your com

#

i will dm you

#

I sent friend request

#

on discord. pls accept it

urban geyser
#

IM LOSING MY FUCKING PATIENCE

shell kernel
urban geyser
#

nothing

wooden glacierBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.

pallid sinew
#

No one see the (f != NULL) return there?

shrewd moon
#

Haha

wooden glacierBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.