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
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 ✌🏼
su
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
su
su
Kenny
Could he use mod operator to know where the i element must go?
Anonymous
Kenny
I remember that, when i tried to rotate arrays
su
j + d can reach array length * 2
Kenny
Yep
su
Kenny
If i have free time, i'll try to solve this
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
Roxifλsz 🇱🇹
CARLY
Anyone who knows C proggraming to help me on something
Roxifλsz 🇱🇹
German
/ban
Dima
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??
Roxifλsz 🇱🇹
[BLĀNK]
[BLĀNK]
klimi
Harsh
Anonymous
Anonymous
Kenny
su
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
ملهــم | Molham
Calculator program using functions?
Javi
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?
First, initialize the pointer to nullptr. Regarding your problem, gdb should tell you whether it is stopping because of a breakpoint or an error. Also you should be able to inspect the stack to see where that error is raised
Anonymous
contracts
They are not part of C++ for now
su
su
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?
Anonymous
su
☬ੴ 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