Parra
what are you implementing? (just curious)
Pavel
what are you implementing? (just curious)
A manager for running some tasks asynchronously based on their dependencies (running systems of an entity-component-system based on their interactions with components)
Hermann
how convert my value in log_10 scale?
ninja
how convert my value in log_10 scale?
you can make loop for n no. of values and use math lib. to find the log10 of the value!
Hermann
you can make loop for n no. of values and use math lib. to find the log10 of the value!
true. I don't know why I wanted to convert my range into log, just calculate the log of my value.
Anonymous
Hello
Anonymous
When i was using double data type it gave me same result as float #include <stdio.h> void main() { double test; scanf("%lf", &test); printf("the input is %lf", test); }
Anonymous
What was my mistake here? Please let me know I'm a newbie in C
robert
can anybody give a hint on how to create the generator of random mazes?
Yasas
I have a litte problem on c++ devolopement. It's not any code or anything. I just wanna know that if I'm doing a Qt project do i have to place Qt in the project folder or add it to the path enviorenmental variable.
Rakesh
/get cppbookguide
Ni
Anybody who can help me with the source code of rock paper scissors in c
Talula
Anybody who can help me with the source code of rock paper scissors in c
Ask input from the user R P S Make a random number between 0..2 0 = R, 1 = P, 2 = S If the user selected R and computer selected with random number P, Computer won. if U = R && C = R then draw if U = R && C = S then User Won
Abhi
/get
Abhi
/get rs aggarwal quantitative aptitude
klimi
How do i make the random number
Rand function might come handy
Cybersecurity Engineer
Hello I'm new here I want to learn c programming language from where I suppose to start I need your guide please?
Cybersecurity Engineer
Books and YouTube
Which kind of book could you guide me please?
Yasas
Help me. @John_minner is pming me
Yasas
/kickme
Yasas
/report @John_minner abuse
Dima
Thanks
el
Assignment 6 In one C++ file, 1. Create the class Child (representation of all children). The class Child should have not less than 4 properties (data members (only one property of the Father class in Assignment 4 & 5 can be repeated please)) and not less than 5 functions (methods(only one function of the Father class in Assignment 4 & 5 can be repeated please)) of your choice. 2. Create at least 4 objects of the class Child ( eg. Kofi, Kojovi etc) and DO NOT assign values to their properties at the time of their creation. 3. Display the properties of the objects created in (2). 4. Create at least 3 other objects of the class Child ( eg. Afua, Amavi etc) and assign values to their properties at the time of their creation. 5. Display the properties of the objects. 6. Change at least 2 properties of at least 3 objects. 7. Display the properties of the objects changed in (6). 8. Let at least 3 objects created perform 2 functions each. Submission date:
klimi
el
Please help me out please and please again🙏🙏🙏
Nick
This not problem this is question😂😂
Yasas
Already banned
Sir can I ask you a question in private?
Gleb
Hi guys, could someone help me in rewriting this code to C++14? { if costexpr (value) { if (!arg) return; } method(); } I guess, I can somehow apply boost::hana::if_, eval_if here, but couldn't figure out how...
Anonymous
Q2: Write a program to initialize a vector to store the students grades and display their grade distribution.😢HELP ME C++
z
Lmao, this !homework GIF goes here too.
Anonymous
Hi all i am qt qml c++ developer
Anonymous
I have a cpp interview coming up, please provide me with some articles or anything i can go through tht cld help my interview
123
Read Mam
Talula
Read Mam
Read what?
123
Pinned Message about warning
Talula
Pinned Message about warning
Mam is a "Bot".
123
Ohh nice
Anonymous
#include <iostream> #include <string> using namespace std; class A; class B; class A { public: B * classProp; A() { this->classProp = new B(); } }; class B { public: string str; }; int main() { A aaa; return 0; } why the error? main.cpp: In constructor 'A::A()': main.cpp:18:33: error: invalid use of incomplete type 'class B' 18 | this->classProp = new B(); | ^ main.cpp:9:7: note: forward declaration of 'class B' 9 | class B; | ^
Anonymous
if i comment line this->classProp has no errors
HaiNahi
Anyone want to learn programming in C, 1$ per hour. I made a chess engine in C language.
Pavel
if i comment line this->classProp has no errors
To construct B the compiler needs the full declaration of class B, forward declaration is not enough. You either need to swap declarations of A and B, or move definition of constructor of class A outside of the class, after the declaration of B. Also note that your code has a memory leak (assuming you fix the error) because you don't delete classProp anywhere.
Anonymous
memory leak i know
Anonymous
i to try another case with passing the forward class to function, but it also not works. I think forward declaration is useless for classes.
Pavel
i to try another case with passing the forward class to function, but it also not works. I think forward declaration is useless for classes.
It's not useless, it's just not enough to construct objects or manipulate with their inner data.
Pavel
Because for that the compiler needs to know how to construct the object, and have info about its members
Anonymous
templates can resolve this
Pavel
templates can resolve this
I think you mix soft and warm, templates and forward declaration are not related
Anonymous
thanks for advice
Pavel
thanks for advice
If something is still unclear, fell free to ask
Anonymous
CAn admins remove it?
Anonymous
Quick question: Can you guys give me a link of the best explanation in Arabic of C++ language on YouTube?
『ᏰᏂ』 User X
who's scraping users from this group and adding us
『ᏰᏂ』 User X
its annoying stop doing that no one gives a fuck about trading
@𝑺𝒐𝒃𝒌𝒂
who's scraping users from this group and adding us
You should change your privacy and security settings to avoid that
The Curious Cat
/get cbook
Anonymous
Pavel
Boss please can you dm
You can ask your questions here if they related to C/C++
el
Ok please
mito
What's happening here? Could anyone tell? #include <stdio.h> int main() { char h = '|'; char v = '_'; char* p = &v; for (int i=0; i<10; i++) { fputs(p, stdout); } printf("\n"); return 0; } Output : _|_|_|_|_|_|_|_|_|_|
Steven
you should use putchar
z
What's happening here? Could anyone tell? #include <stdio.h> int main() { char h = '|'; char v = '_'; char* p = &v; for (int i=0; i<10; i++) { fputs(p, stdout); } printf("\n"); return 0; } Output : _|_|_|_|_|_|_|_|_|_|
fputs() will stop printing when it finds a NUL char. In your case, you're inadvertently accessing char h, and after that it's lucky, it finds a NUL char. But you're basically reading random data from the stack, it is just a coincidence you find a NUL char before you get memory access violation.
mito
Im fine with the a link to an article on that too.
z
Could you tell me how it's inadvertently accessing char h in detail?
It's inadvertently because there is no guarantee about memory order of local variables on the stack. By doing so, you're invoking undefined behavior.
lostintheuniverse
get cppbookguide