klimi
you are missing main function
klimi
int main() { your code here }
Anonymous
On a school project and I've encountered this. What do I do?
nothing you just declared main function but haven’t defined it
Anonymous
add main() before curly brace
Anonymous
Did he declare main?
Anonymous
yes
Anonymous
line 3
Artöm
Good programmers always declare main before defining it
Artöm
Better move main declaration to main.h and include it in main.cpp. Thats how one does stuff
NXiss7
Did he declare main?
Declared but not defined
Artöm
He isnt using headers smh
NXiss7
😄
Anonymous
Good programmers always declare main before defining it
nothing wrong in declaring main before and that can’t make you good or bad… cause when defining you will havie to write main() before “{“ so it’s like writing the same thing again… if it is school project they must be wanna check whether you understand function syntax properly or not… cause again writing int main() will throw an error during compiling…
Anonymous
yep I said already it’s like witing the same thing again but for school project they must be wanna check if someone defines it again and face an compilation error
Anonymous
I don't understand please elaborate🥺
Anonymous
function declared and defined later
Anonymous
in that case it’s main() function
Anonymous
I think you get it C. E. O
Anonymous
I believe I do I'll go through it again Thanks for the help😊
Anonymous
Can we declare static constructor....?
Wisenky
hy guys
Ayush Srivastava 22MCA10118
For learn programming please visit Backbenchernotes.com
Anonymous
what for?
Like this static constructor() { }
Nameful
But why?
Nameful
What would a static constructor be?
Wisenky
For learn programming please visit Backbenchernotes.com
a have a question about strings , how can I get integer from char array inside txt file ?
Wisenky
for example I have a txt file and information about a name , age , job inside it . Im trying to print job who is older than 30
Wisenky
Im newbie
Wisenky
Wisenky
Anyone has idea ? thanks
Dima
Anyone has idea ? thanks
You can use strtok and atoi() age
Anonymous
Thank you I'm sorry because I late to reply you
Anonymous
Can we declare static constructor....?
AFAIK there is no such thing as static constructor in C++, however you might simulate such thing using static/global objects with normal constructors. these constructors will always be called before main(), no matter they are actually needed or not
Wisenky
You can use strtok and atoi() age
solved with my easier way , and thanks alot for your opinion :)
Dima
I thought you are having troubles with parsing those lines
Dima
good for you
Wisenky
I wasnt know if I put two %s inside scanf it can get two of strings
Anonymous
Hi
Rajath V
https://www.linkedin.com/posts/rajath-v_tensorflow-flutter-dataset-activity-6638666920935686144-jrmU
litepresence
I have massive array of integers from 1 to 3.7 billion; I need to take square root, I can accept the closest integer solution. efficiency is of the utmost importance. is there a faster way than cmath sqrt() ??
litepresence
thanks will research, do you have any link you can share?
01000001011011010100000101101110
https://stackoverflow.com/a/19611407/8258801
Anonymous
Best Square Root Method - Algorithm - Function (Precision VS Speed) - CodeProject https://www.codeproject.com/Articles/69941/Best-Square-Root-Method-Algorithm-Function-Precisi
litepresence
you guys are awesome. huge.
Anonymous
you guys are awesome. huge.
We know how to use google
Anonymous
:D
shubham
can anyone tell me its solution ?
01000001011011010100000101101110
shubham
well answer is coming 36
shubham
but idk why
01000001011011010100000101101110
well answer is coming 36
Yes It is correct
01000001011011010100000101101110
but idk why
Because of the macro. X = 36 / 6 * 6
01000001011011010100000101101110
Because of the macro. X = 36 / 6 * 6
Which is 36 as ( 36/6 = 6 then 6*6 is 36)
Xcruzhd2
Because of the macro. X = 36 / 6 * 6
Is it not like X = 36/(6*6)?
01000001011011010100000101101110
Is it not like X = 36/(6*6)?
No, Try reading the macro definition.
Xcruzhd2
No, Try reading the macro definition.
Hey bro we have same name with same surname
Anonymous
It’s like replace the words not doing math🙃
01000001011011010100000101101110
01000001011011010100000101101110
It’s like replace the words not doing math🙃
Yes and always with priority of operators.
Anonymous
Akash
How can I move text cursor up in c++
Pavel
How can I move text cursor up in c++
If you're talking about mouse cursor and windows, then you probably need winapi https://stackoverflow.com/questions/22259936/c-move-mouse-in-windows-using-setcursorpos
Asdew
If the terminal supports ANSI escape codes, you can use them.
Anonymous
Please is this the right algorithm of this question
Anonymous
Anonymous
☝🏾
Anonymous
??
Pavel
Please is this the right algorithm of this question
The task is not clear for me (what are desired formats of the inputs and outputs). In some interpretation of the task this can be a correct answer, I think.