#How do I make a C program read a string from a text file?

30 messages · Page 1 of 1 (latest)

tight cove
plucky doveBOT
#

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.

gusty cedar
#

@tight cove What have you tried so far

tight cove
tight cove
gusty cedar
tight cove
gusty cedar
tight cove
gusty cedar
#

Not quite

#

It's an array of 100 char*'s

#

I.e., a pointer to a character / character array

tight cove
gusty cedar
#

You need to be precise

#

Both scanf and fopen take a string

#

str is not a string

tight cove
gusty cedar
#

A string is an array of characters

tight cove
gusty cedar
#

Perfect

tight cove
#

Thank you

#

This is way more complicated than Python

gusty cedar
#

Yes

#

You'll get the hang of it though

tight cove
gusty cedar
#

What is str now?

plucky doveBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity