Anonymous
Hi i wanna create process and thread by pure C code and dont use windows API or posix standard , can you introduce article(s) about it. Thanks for your help
Ammar
Anonymous
#include<iostream>
using namespace std;
int main()
{
int n,i,j;
int arr[]={4,7,9,3,5,6};
int temp=0;
printf("%d",arr[6]);
for( int i=1;i<n;++i){
for ( int j=i+1;j<n;++j){
if(arr[i]<arr[j])
arr[i]=arr[n];
{ temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;}}}
for( int i=1;i<n;++i){printf("%d",arr[i]);}
return 0;
}
Array indexes start from 0 and not 1. arr[6] refers to a non existent element.
In your for loop, i has to start from 0
The value of n is not defined.
Ammar
Anonymous
Ammar
Ammar
Try to open the man page and type
/CONFORMING TO
Ammar
If you don't want to use the libc API wrapper for that clone(2), you can craft your own syscall code for arch specific with inline Assembly in your C code.
Anonymous
Captain
saa~
Izin bertanya ini,caranya bagaimana ya supaya tidak eror?
#include<iostream>
#include<conio.h>
using namespace std;
int main ();
{
char a, b, c = 0, d = 0, e = 0, f = 0 : //Deklarasi
cout<<"masukkan nilai A :";
cin>>A;
cout<<"masukkan nilai B :";
cin>>b;
c = a * b:
d = a \ B;
e = a + b;
f = a - b;
cout<<"\nHasil dari C = A * B ="<<c<<end1;
cout<<"Hasil dari C = A / B ="<<D<<end1;
cout>>"Hasil dari C = A + B ="<<e<<end1;
cout<<"Hasil dari C = A - B =">>F<<end1;
getch();
}
Captain
Dima
english only
Captain
english only
I know i just replied in sarcastic way😁
D
guys
follow the rules cause in other case mess is creating
Dima
/ban 2001864576 go fuck yorself
Anonymous
anyone who wanna help me java, im stuck with this code
https://pastebin.com/b1srFHkb
Anonymous
Anonymous
Most distributions are POSIX compliant but are not certified because they don’t want to pay the extra fee to get certified
Anonymous
You should use POSIX api to make your applications portable most Linux distributions have extra api features so you can also use this at the risk of portability
Anonymous
/get cbook
Anonymous
Anyone good in C or java or c++ or python language
Pls msg me urgently
olli
Anonymous
Apk
Coding
yeah ask your question
Anshul
after submission on leetcode, i got this error. i don't know the reason for it. can anyone help me
Dr
I guess you utilized some more than allocated memory for your program👀
Anshul
class Solution {
public:
void nextPermutation(vector<int>& nums) {
int n=nums.size();
int i=n-1;
for(;i>=0;i--)
{
if(nums[i]<nums[i+1])
{
break;
}
}
if(i<0)
{
//elements are in descending order
reverse(nums.begin(),nums.end());
return;
}
int j=n-1;
for(;j>i;j--)
{
if(nums[j]>nums[i])
{
break;
}
}
swap(nums[j],nums[i]);
return;
}
};
Anshul
this is the code. i'm using no extra space
Jasur Fozilov 🐳
Dr
Bro when you're doing nums[i]<nums[i+1] in if condition,
And i=n-1, isn't it accessing nums[n] for i+1th index
Anshul
oh thanks
Anshul
Anshul
Anonymous
Koi. Hacking class krta h??
Pavel
Anonymous
Any one here do hacking class
Anonymous
I need contents of Hacking
DEV 7
#include <iostream>
using namespace std;
void print(int n){
if(n < 0){
return;
}
if(n == 0){
cout << n ;
return;
}
print(n --);
cout << n ;
}
int main() {
int num = 3;
print(num);
}
why this program give runtime error
Khushi
Hey..
I am thinking to start learning c language. If anyone could help... please dm me
Talula
Dr
Talula
I don't think he wants to return anything, he wants it to count backward using recursion.
Ehsan
DEV 7
DEV 7
#include<iostream>
using namespace std;
int sumarray(int* arr, int size ){
static int i=0;
int sum;
if(i>size){
return 0;
}
sum=arr[i]+sumarray(arr,size-1);
i++;
return sum;
}
int main(){
int arr[4]={1,2,3,4};
cout<<sumarray(arr,4);
return 0;
}
i want to get sum of arrays using recursion , whats wrong with above code ?
Ehsan
Ehsan
DEV 7
Ehsan
that’s it
DEV 7
Ehsan
you don’t even need sum
Ehsan
int sumarray(int* arr, int size ){
if(size == 0)
return 0;
return arr[size-1] + sumarray(arr, size-1);
}
DEV 7
Ale
Hi, could someone help me with this program?
Ale
Create a program that calculates the cash balance relating to a series of amounts entered cyclically by a user: the entry ends when 0 is typed which acts as a stopper of the sequence.
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
.
Dr
suleiman
What is nested if?
Dr
If within if
Vlad
Anonymous
Dr
Anonymous
Whats a good book
Anonymous
For. C++
Anonymous
Which can cover everything
klimi
cover everything?... i don't think that book exists... just pick one you like or look on stackoverflow if you need word from others
Abhishek
Can any one tell me best place to learn c++ from beginning
Talula
Abhishek
😂😂😂 I know that
Dr
Practising in the above mentioned platforms can boost your confidence
Dr
Khaerul
No