0
why is it when i copy and paste a code it works and when i type it dont work
When i type a cody just like it shows it says error, but when i copy a code ams paste it and do run it works but it wont when i type it what is the problem with that??
4 Respostas
+ 5
Well there could be a chance that when you are typing, you made any syntax error or some other error.
If you could show that what code you are copying and pasting works fine and what code you type gives error so that we can help you.
+ 3
Michael Munn the only thing I can think of is your writing it down wrong. but if your not then I dont know what to say
+ 3
How easy to miss a little ';', to overlook a tiny '{'. Maybe one letter is capital although it shouldn't be, or some '<<' got lost in translation ...
I remember writing the same line with a few sets of parentheses over and over until I finally found the one '(' sitting in the wrong spot.
I suppose that's the taste of coding and you just have to practice until you see (more of) these tiny things that mess it all up.
Aren't there a lot of memes going around here about that single missing ';' that can't be found or about waking hours at night where the solution to a problem was 'almost there'?
I think it helps to write your code line by line. Write, test, does it work? If yes, write the next line ...
0
I'm so late to this, but this question might even be a little inside joke with yourself. Given the way you typed your question, I can see the issue with proofreading what you type as opposed to simply copying from somewhere else.