Anshul
*standard
Anonymous
Anonymous
How do I know which version I'm using
You can program in old style C++ in modern compilers as well. Your code will compile just fine. From your other posts it looked like you are using Visual Code and gcc (probably from mingw). You would then likely be using a compiler that supports atleast C++17
Anonymous
should I declare functions like this
Anonymous
int main(void)
Anonymous
Or int main()
Anshul
Anonymous
int main(void)
In C, for declarations always use int func(void); For definitions int func(void) or int func() would both be equivalent
Anonymous
To follow the c standard int main(void)?
Anshul
Anonymous
isn’t Mingw outdated?
Anonymous
For windows I think MSVC is much better
JP
/get cbook
Anshul
What's msvc?
Btw what's the difference between MinGW and GCC?
Anonymous
isn’t Mingw outdated?
It is not. You have a choice between MSYS or mingw. I have been told that MSYS supports newer compiler versions faster than mingw.
Anonymous
Anonymous
It’s a compiler made by Microsoft for windows
Anshul
Anonymous
Anonymous
GCC stands for GNU compiler collection
Anonymous
It support C/C++ and many more languages
Anonymous
it’s mainly for Linux but Mingw supports windows
Anshul
Okay
Yusuf
/get cppbookguide
Anshul
Is mingw some company name?
Anonymous
The best way to learn C/C++ is via book because they cover details
Anshul
What's minimalist
Anonymous
It means small
Pavel
Anshul
Anonymous
Anonymous
The best way to learn C++
Anshul
No it stands for minimalist GCC for windows
When I started programming. I learnt that there is a compiler which compiles the code. But later when I downloaded compiler and ide. I got to know there are many compilers many names. So it's quite confusing in terms of what's actually compiling my code? Whether it's mingw/gcc or some other thing
Anonymous
It’s gcc that’s compiling your code because you are using Mingw
Anonymous
https://en.m.wikipedia.org/wiki/MinGW
Anonymous
GCC comes pre installed with Linux
Anonymous
It supports many languages but mingw only supports C/C++
Anshul
What's g++
Anonymous
C++ compiler
Anonymous
G++ only compiles C++ code
Anshul
Does it come pre installed with windows
Anonymous
Nah
Anshul
Or with visual studio code
Anonymous
No
Anonymous
They have to be manually installed
Anonymous
https://en.m.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
Anonymous
Anshul
Because I think I never downloaded it but today when I was learning a little about debugging, visual studio code asked me to make some json file and then it added g++ as a default to build any task
Anonymous
Yeah when you are compiling C++ code invoke it with “g++” when you are compiling C code invoke “gcc”
Anshul
So mingw have both gcc and g++ right
Anonymous
Yeah
Anonymous
I don’t use windows but on there site it says supported languages C/C++
Anshul
Alright
Anshul
Anonymous
Android uses clang as a C/C++ compiler
Anonymous
Different systems use different compilers
Anonymous
My favorite compilers are Clang and GCC 🙂
Anshul
Okay
Anshul
Different compilers can have different times of compiling the code and running it?
Anonymous
Probably
Anonymous
Pavel what compiler do you use?
Pavel
Pavel what compiler do you use?
I use MSVC to compile on windows, and gcc when compile on Linux (hopefully my code should also compile with clang, but I haven't tested it for a long time).
Anonymous
It should work
Anonymous
Under clang
Anonymous
(lldb) p getRelativePosition().topLeft
(Position) $3 = (x = 0, y = 0)
(lldb) p getAbsolutePosition().topLeft
(Position) $4 = (x = 0, y = 0)
(lldb)
auto local = Position(touch.x, touch.y) - getAbsolutePosition().topLeft;
auto percentage = local / getRelativePosition().topLeft;
auto pos = percentage * Position(newWidth, newHeight);
what do i do when percentage is +inf, +inf
Anonymous
#include<stdio.h>
#include<string.h>
//#define UNIT_COST 450;
void main() {
float unitsConsumed;
char Customername[20];
int customerid;
float Totalcost;
printf("Enter Customer id:");
scanf_s("%d", &customerid);
printf("Enter Customer Name:");
scanf_s("%s", &Customername);
printf("Enter Number of units consumed");
scanf_s("%f", &unitsConsumed);
Totalcost = 450 * unitsConsumed;
printf("Total cost of power is %f", Totalcost);
}
Anonymous
Severity Code Description Project File Line Suppression State
Warning C6064 Missing integer argument to 'scanf_s' that corresponds to conversion specifier '2'. Project1 C:\Users\kk2\source\repos\Project1\Project1\Source.c 13
Anonymous
what kind of warning is this vs is throwing? on line scanf_s(%s,&customername)
Anonymous
Anonymous
Missing integer argument to 'scanf_s' that corresponds to conversion specifier '2'.
Anonymous