C
Join ServerC#
help
❔ Reusing strings across classes
LCLewis C1/24/2023
This is file 1
https://cdn.discordapp.com/attachments/987310138195054592/1067462232860004433/image0.jpg
I’d like to store and using the string content in other classes
Like this
https://cdn.discordapp.com/attachments/987310138195054592/1067462409738010634/image0.jpg
But I have the red line of doom. What am I doing wrong
https://cdn.discordapp.com/attachments/987310138195054592/1067462232860004433/image0.jpg
I’d like to store and using the string content in other classes
Like this
https://cdn.discordapp.com/attachments/987310138195054592/1067462409738010634/image0.jpg
But I have the red line of doom. What am I doing wrong
TTheRanger1/24/2023
what does the error message say
AAngius1/24/2023
OneFileAuth
doesn't have any content
AAngius1/24/2023
Not a field
AAngius1/24/2023
Not a property
AAngius1/24/2023
Not a method
TTheRanger1/24/2023
it could be non static too
LCLewis C1/24/2023
Do I need to store the string another way
LCLewis C1/24/2023
It doesn’t contain a definition for “content”
AAngius1/24/2023
Because it doesn't
AAngius1/24/2023
content
is a local variable inside of your Main
methodLCLewis C1/24/2023
Ah so it suggested adding “internal static string content” above the main
AAccord1/25/2023
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.