P
I have written article, where C++ used in real world application. Hope you will like it.
P
https://mrcodehunter.com/what-is-cpp-used-for-real-world-applications/
Ausir
Hi guys, I have a question about execv() function because a can't find answers in Google: if I got the pid of my child process before the call to execv("./myprogram", args) function, myprogram as process has a different pid or the same that I got when I called getpid() before the execv?
Anonymous
Don't forget to block and report
yeye i usually do only that. this time thought about going the extra mile
Anonymous
Actually 😅 I have tried in this way Also but I don't know I made mistake in somewhere ..... In the code.... Segmentation fault error came That's why I left this logic .... And implemented as I have shared.... Btw thanks buddy....
Anonymous
Hi
Ausir
Ty so much ✌🏼
Anonymous
int rotatearr(int arr[],int d,int n) { int index =0; int temp[d]; //Copying element into temp for(int i=0;i<d;i++) { temp[i]=arr[i]; } //Shifting element by d position so //every element get into proper place for(int j=0;j<n;j++) { arr[j]=arr[j+d]; } //rejoining element for(int k=n-d;k<n;k++) { arr[k]=temp[index]; index++; } return 0; }
Anonymous
Here is the idea Now tell me where I am wrong I typed this in mobile now so may be I got wrong somewhere ... But I have tried this on pc also ......
su
of cause, if you free memory page, it returns to OS pool, so next time you access the stored somewhere memory address, you get segfault error
Anonymous
everything is wrong. size of array arr may be greater, equal or less than parameter d
No it's going to be always less than The size of array And yeah D is the number upto which we have to rotate tha array right It may be 2,3,4,5etc
su
No it's going to be always less than The size of array And yeah D is the number upto which we have to rotate tha array right It may be 2,3,4,5etc
you should be adding ASSERTs on constraints you mentioned to be SHURE that all your mentioned are takin into account by external code
su
No it's going to be always less than The size of array And yeah D is the number upto which we have to rotate tha array right It may be 2,3,4,5etc
also, you have to add constraints for all array index accessors like arr[j+d] etc, to enshure that all j+d values are not goes over the bounds of the array, even by one element
Kenny
Could he use mod operator to know where the i element must go?
Anonymous
also, you have to add constraints for all array index accessors like arr[j+d] etc, to enshure that all j+d values are not goes over the bounds of the array, even by one element
I guess I got something here😁 Thanks buddy Will going to see this in morning ☺️ (Trying to do that problem).... Thnx ....
Kenny
I remember that, when i tried to rotate arrays
su
Could he use mod operator to know where the i element must go?
i have no idea what is going to be, there are no comments, arr[j+d] it will raise exception by any means
su
j + d can reach array length * 2
Kenny
Yep
su
I remember that, when i tried to rotate arrays
he is not rotating array, he goes far beyound and array boundaries with arr[j+d];
su
Yep
!up
Kenny
If i have free time, i'll try to solve this
Anonymous
he is not rotating array, he goes far beyound and array boundaries with arr[j+d];
Yup bro May be that ' s why I got that error .... Will going to make it now 😜
Asdew
/report
Roxifλsz 🇱🇹
/ban
Asdew
You're a moderator?
Roxifλsz 🇱🇹
Yuh
Asdew
For how long?
Roxifλsz 🇱🇹
I was one of the first admins, then I left this group for a while. Now I'm back since yesterday
Asdew
Oh.
Roxifλsz 🇱🇹
Yeah I think I first became an admin when this group had 300 members
Asdew
When was that?
Roxifλsz 🇱🇹
2017-12-15
Dima
2017-12-15
the strange thing that you didnt tell the full time
Dima
2017-12-05T12:34:42.00000+00:02
CARLY
Anyone who knows C proggraming to help me on something
Roxifλsz 🇱🇹
Anyone who knows C proggraming to help me on something
/ban all 3 messages posted by user were cringe
German
/ban
Dima
/ban
do you want one?
German
Bruh😂
German
Naah I'm good thx
Anonymous
Madhav
Message
V
I need someone who can make c program . Please PM me I will pay .
Venom
. Write an algorithm on sheet to perform Bubble sort on minimum 7 element of string type as per your choice in descending order. After sorting the array also insert one new element as per your choice in the mid and make sure the array remain sorted. You also need to dry run the algorithm by explaining step by step for first three iteration of sorting and then the last about inserted element in the list .
Venom
Any one solve this
Anonymous
sort an array elements program??
klimi
/ban homework
What!? No way!
Roxifλsz 🇱🇹
What!? No way!
Ok, non-admin
klimi
Ok, non-admin
Come to ot and talk to me lol
Roxifλsz 🇱🇹
Come to ot and talk to me lol
Our PMs is OT ( ͡° ͜ʖ ͡°)
Harsh
I need someone who can make c program . Please PM me I will pay .
You don't need to pay There are online resources
Anonymous
Message
this seems like a bot now
Anonymous
first message was a Hi (few days ago)
Anonymous
data collection bot with name stolen from a member?
Ilsaf
@tech_not_life
klimi
@tech_not_life
what's that
ملهــم | Molham
Calculator program using functions?
Daniele
Hi everyone, I have an issue with my code. I want to create some object dynamically using new, I have a class called "Projectile", so I created a poiner Projectile* proj and initialize it to NULL. I can easily create and initialize the data for this pointer using proj = new Projectile in the main, but there are some instances where I need to delete the contents of this pointer during a call to a function called Projectile::move(Projectile** proj). In move(), when I check the condition for the deletion of the pointer, I use delete *proj, which sounds good at first because the pointer is initialized back to NULL. The issue comes when I try to create another Projectile on the same pointer *proj, the debugger (gdb on mingw windows) stops execution because of a breakpoint trap. I do not have any breakpoints so I my only guess is that the program has a memory leak related to the deletion (or creation, or both) of the *proj pointer. Is there a way to create and destroy objects properly without memory leaks? tl:dr how can I use new and delete on only one pointer?
Anonymous
What is then?
Templates and metaprogramming
Anonymous
contracts
They are not part of C++ for now
Anonymous
hmmm. templates then
But maybe you will like concepts? :)
Ajay
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll loop = 1e18; ll ans = 0; ll a=0, b=0; for (ll i = -loop; i < loop; i++){ a += ans; b += a; ans = ans + 1; a -= ans-1; b-=a+ans-1; } cout << a << endl; } This works with turning on the optimisations(LOOP doesn't give Time limit exceeded). Huh ! Is that thing resolved during compile time? If so, how? And why in this case?
☬ੴ Bassi
just a suggestion... would it be ok to put a filter on that only after x amount of posts you are able to share links.. prior to that allow links only to something like pastebin or something