Madhavi
Param1 but data structure of param1 different..call made from 2 different places
\Device\NUL
Param1 but data structure of param1 different..call made from 2 different places
I'm not understand, can you explain your question more clearly ?
Madhavi
CreateRecord( DSparam1 param1; ) { } where DSparam1 is the datastructure and param1 is the variable. The fuction CreateRecord(param1) and CreateRecord(param2)have been called from 2 different instances BUT Is it possible that passed parament param1 and param2 are of 2 different Datastructure
Madhavi
Like DSparam1 param1;
Madhavi
DSparam2 param2;
Madhavi
DSparam1 and DSparam2 are datastructure
Abdulaziz
extend DSParam1 and DSParam2 classes to one BaseParam class and change like CreateRecord(BaseParam param){}
Madhavi
How to extend two datastructure to one baseparam
Abdulaziz
first create BaseParam class then you can extend like this DSParam1 : public BaseParam { ... } DSParam2 : public BaseParam { ... }
Indic
Im unable to install gcc
Indic
Its downloading a zip file
Indic
There is no setup file
\Device\NUL
Sender
Hi
Sender
I have best online free courses with certificate you can apply in website please DM me
Anonymous
Looking for a good c++ coder will be paying in btc
.
Free
Ok how can I register
.
And is it possible for me to involve as a beginner
.
Absolutely
Thanks a bunch ankita , I really thank u for sharing me this important opportunity👍👍👍
cecini
what is the perf overhead ponit when do some abstract or emcompass using c?
cecini
cecini: what is the perf overhead ponit when do some abstract or emcompass using c? someone sugges few abstract。
Andrii
I have main.cpp and header.h. In CMakeLists.txt I write: add_executable(main main.cpp header.h) There is a function defined in header.h and its prototype in main.cpp, I don't #include header.h in main.cpp. The problem is that linker can't link function prototype from main.cpp with its definition in header.h. But it's enough for me to rename header.h to header.cpp (in CMakeLists.txt also) and everything works as intended. What's wrong? (And yes, I know that defining function in a header is not the best practice).
Anonymous
What a attitude👍
Anonymous
I have some questions about coroutine s. 1.how to calculate the size of coroutine frame,. 2.where is executing stack of coroutine,. 3.how to execute coroutine on a different thread Plz help me.
MᏫᎻᎯᎷᎷᎬᎠ
Welcome
Бүләт
Hi everyone)
Anonymous
guys anyone free to help? it's about struct and stuff
Daphne
Hi
0! = 1
Hey
.
!report
She hasn't done anything , she is helping us in education ,why you reported, it's unfair !! please admins don't ban ankita if you ban ankita ban me and also my friends I'll tell them to leave the group , ankita hasn't done nothing but she has shared us an important thing
Kuon
I think it’s just an ad
Mr
Agree
Sender
Computer Science and Engineering 4th year
Anonymous
I have some questions about coroutine s. 1.how to calculate the size of coroutine frame,. 2.where is executing stack of coroutine,. 3.how to execute coroutine on a different thread Plz help me.
1. Here are two papers that you can go through. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0981r0.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1365r0.pdf The first deals with the situation in which heap allocations for coroutines can be optimized away and the second one deals with conditions whereheap allocations is not possible. There is a dirty way to find the size of the frame needed for a coroutine by overloading operator new and capturing the size of the bytes required provided your use case doesn't fall into the cases listed in paper one. Apart from this there is no standard way to do so. 2. Mostly on the heap but read the papers above. 3. Run the resume function for the coroutine handle in a different thread.
Ammar
Just want to add that false sharing can happen even with your data being cache aligned. You need to do more to prevent false sharing apart from just aligning the data with L1 cache
> You need to do more to prevent false sharing apart from just aligning the data with L1 cache Interesting, I don't know much about this, care to shed some light about the "do more" part? Or maybe a keyword for me to google is nice.
Anonymous
Because the Header file is not included in the main.cpp The linker doesn't link between headers and .cpp files Header files act only as interfaces to other source files and also it can consist of implementation Actually, it's just a copy - paste procedure in inclusion of the header files
It is not the linker. Actually it is the compiler which ignores header files and thus does not generate the object files from them. The linker is blissfully unaware of headers and cpp files and deals with object files alone.
Daphne
Hi
Anonymous
> You need to do more to prevent false sharing apart from just aligning the data with L1 cache Interesting, I don't know much about this, care to shed some light about the "do more" part? Or maybe a keyword for me to google is nice.
Well assuming that your data is cache aligned and is occupying an entire row of the cache (thus not sharing the row with other unrelated objects). Now if multiple threads in your application access different parts of your datastructure and update them separately, you will still have issues with false sharing where the updates result in unnecessary retrievals from the memory. The way to prevent this is by using thread specific mapped variables. You can read about it here : https://wiki.cdot.senecacollege.ca/wiki/Team_False_Sharing In one of the examples, they deal with the usecase I gave above
Ammar
Well assuming that your data is cache aligned and is occupying an entire row of the cache (thus not sharing the row with other unrelated objects). Now if multiple threads in your application access different parts of your datastructure and update them separately, you will still have issues with false sharing where the updates result in unnecessary retrievals from the memory. The way to prevent this is by using thread specific mapped variables. You can read about it here : https://wiki.cdot.senecacollege.ca/wiki/Team_False_Sharing In one of the examples, they deal with the usecase I gave above
Ok, it makes sense. Just to confirm my understanding, assuming I have struct my_data { int a; int b; } ____cacheline_aligned_in_smp; I have 2 cores, Core 0 updating a, Core 1 updating b, they both (a and b) are completely independent with respect to the given task. Then false sharing happens since both in the same cache line. If I do ____cacheline_aligned_in_smp int a; ____cacheline_aligned_in_smp int b; given the same situation as above, false sharing does not happen. Is that correct?
Ammar
Yes but this wastes precious L1 cache space. A better way to do this would be using thread private data.
Yeah, I am well aware of wasting space here, just to give a super simple example. 👍
Anonymous
#include <stdio.h> #include <string.h> int check_passwort () { char eingabe [0 x10 ]; gets(input ); return !strcmp(eingabe , "password"); } void zugang () { printf("Welcome!\n"); execve("/bin/sh", NULL , NULL ); // Starts a shell. } int main(int argc , char** args) { printf("Enter your password: "); if ( check_passwort ()) { zugang (); } return 0; }
Anonymous
I have this given program. I wanted to know the stack frame of the check_password function including the addressing
muveey
Hello my friends please i need help with C++ programs using operating system scheduling algorithms e.g first come first serve(FCFS), round robin, shortest job first e.t.c
Anonymous
I want to know ,what tool you use for reading linux sourcecode
Anonymous
it is too slow like using vscode,
Anonymous
and clion can't be configed
Bwam🇭🇹🇭🇹
Can someone help me with a C++ Problem, please ?
artemetra 🇺🇦
Peace
I am having problem with these commented lines (these concepts) in the following code.. please guide me or refer something which can teach me these concepts easily. class Node{ public: int key; int data; Node* next; // not getting this step // please explain two constructor concept or refer something Node(){ key = 0; data = 0; next = NULL; } Node(int k,int d){ key = k; data = d; next = NULL; } };
Anonymous
in python i=0 while (i<4): print(f"blabla{i}") i=i+1 # output blabla1 blabla2 blabla3 how can I do with c plz
Anonymous
in python i=0 while (i<4): print(f"blabla{i}") i=i+1 # output blabla1 blabla2 blabla3 how can I do with c plz
In python, you can use the walrus operator or range to make it more concise. In C, you can do while(i < 4) printf("blabla %d \n", i++);
Anonymous
thank you first . no this just example I wan to declare various file in one line like int main() { FILE*fp; for(int i=0.....) fp{i}=open(fp"name_file{i}","w");
Anonymous
so I can't do that !
No you can't dynamically construct variable names in C. It is statically typed language. The file names (the name of the file that you pass in as a const char* argument) can be constructed dynamically but. You just have to use one of the format methods like snprintf.
\Device\NUL
it is too slow like using vscode,
Linus didn't use GUI Text Editor
Prince Fine
why is using namespace std is not recommended by many programmers in C++ ?
Anonymous
why is using namespace std is not recommended by many programmers in C++ ?
https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice
Anonymous
Hi all, I need some help here #include<iostream> #include<string> using namespace std; class Books { public: string author; float cost; string tittle; string publisher; float account_number; int copies; void setdata(); }; { cout<<"\n Enter the following details:\ I'm getting the error : expected unqualified id before '{' token. after the class, any idea where i might be wrong