r/CodingForBeginners • • 5h ago

What does this mean?

2nd time ever coding, I have seen this message like 40 times now and I'm slowly losing my mind.

I'm trying to create tool to calculate m/s into km/h but I just don't understand anything from these errors.

2 Upvotes

3 comments sorted by

1

u/Technical_Drink_846 4h ago

I think you'd have a much easier time if you began learning using the JavaScript console in your browser. C++ is very complicated, and the C++ code that you are writing is old. Most online C++ tutorials still teach old concepts and use standard library functions that have largely been superseded. You're also using a C++ build system and an IDE which are professional tools. I found them incredibly confusing as a beginner. Once you've used some easier languages like JavaScript or Python you'll have a better understanding of how to use C++.

cout has been replaced with std::print and std::format,

cin isn't usually used with the extraction operator anymore. instead most people call std::getline and use std::from_chars.

Learning old C++ will just cause problems going forward as more and more libraries move toward C++17 and newer. Look here for JavaScript. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide

If you want to save your code save it in a .html file structured like this

<script> your code here </script>

Double click it or drag it into the browser you use and open the developer console to see output

1

u/Calm-Floor2163 3h ago

can't do sadly xD it's part of college assignment the teach' wanted us to do all by ourselves (after 1 day of coding, whether that's good or bad)

2

u/szank 4h ago

What's in your metrynmetry or whatnot file ? The error is quite explicit. You have two definitions of the main func and your are showing us only one file here. While trying to compile two together