✅ I have 5 errors and have 0 ideas on how to fix them :(
Ok so i havve syntax error, '(' expected at line 31
i havev ) expected at line 31
i havve ; expected at line 31
i have cannot implicitly convertt type 'Char' to 'string' on line 29
and cannot implicitly convert type 'string' to 'bool'
34 Replies
how do i make like the website thing
$paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
BlazeBin - sneylubswxkr
A tool for sharing your source code with the world!
if userinput = letter { Console.WriteLine(letter, "_____")};
This is probably your problem
Firstly, the if is missing the () around the conditionwhere
Secondly,
=
is assignment, you need ==
around userinput = letter
Thirdly, you're missing a ;
after Console.WriteLine(letter, "_____")
And you don't need the ;
after the }
i removed that one but when i put == at more errors come up
that line is fine, except it needs to be a
char
and not a string
what is char
tho
it's a single character of text
a string is many characters
2 more errors came up when i changed it to char
what errors
i think its cuz i did userinput == letter and userinput is string
the errors operator '==' cannot be applied to operands of type 'string' and 'char'
and
argument 1. cannot convert from 'chat' to string
both line 32
try calling
.ToString()
on your letter
or turn your user input into a char, which probably makes more sense given the contextdidnt work
u mean like right theres not another method??
no
i mean literally
.ToString()
or in that case userInput[0]
to get the first character of the input stringdont work tho
Can you $paste your updated code?
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
ok
"dont work" isn't useful information
BlazeBin - fglgrdmjvloq
A tool for sharing your source code with the world!
well i dont know what to tell you nothing changed the two errors are still there
could tell you that tho so mb ig
Convert.ToString(letter);
this doesn't do anything on a line by itself
also, don't use Convert
why not
because it's an old API and there's no point
what do i use then??
call
letter.ToString()
like i suggested earlier, and you have to either use the result of that directly in your if or put the result in a variableok
it doesn't change what type
letter
is, it gives you a new value that's the type you wantwhat?
a new value
yes
like
var letterString = letter.ToString()
ohhh
ok no more errors thank you