mito
z
Different compiler may yield different result, because of UB.
z
Even at different optimization level, UB may yield different result as well.
mito
z
z
It may not even be on the stack if you use higher optimization level. The compiler may elide unused variables.
mito
Exactly.
ok, thankyou, I'll look into fputs() further to know what it exactly does...
Anonymous
Am a learner how can you help me
Anonymous
#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(VA_ARGS, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(VA_ARGS)(VA_ARGS)
can anyone explain wat does FOR(...) and FORC() and GET5() expands to
Anonymous
On a machine where sizeof(float) is 4 and sizeof(double) is 8,
float f = 2.5 uses 8 bytes of memory, since floating point literals are of type double by default.
float f = 2.5f uses 4 bytes, since the suffix f tells the compiler to treat the constant 2.5 as a float.
Is my understanding correct? Also, how does the conversion from double to float work? Does it need to allocate separate memory for the converted float?
Mar!o
Giuseppe
Import gc
Del list
Del myarray
gc.collect()
It is a way to free the memory in Python? Isn't?
Anonymous
Talula
Mar!o
Anonymous
Mar!o
MSP
I need job
Sachin
Any program to find smallest no in array having time complexity less than O(n)
z
z
Oh less than O(n), I don't think so.
z
Sachin
Sachin
Apk
Sachin
Sachin
Time complexity
Apk
Sachin
Exactly
Any shorting less than oo of n
Apk
So most probably no
Sachin
Apk
Sachin
Tunechi
Guys who is able to make a robot to do some task
Dishant
I have recently started learning REGEX but however I am unable to know what is the syntax and functions used in regex . It would be appreciated if anyone can tell me some reliable source to know about this !!
Telebotik
Adarsh
#include<bits/stdc++.h>
using namespace std;
int maxCircularSum(int arr[],int n)
{
int res=arr[0];
for(int i=0;i<n;i++)
{
int curr_max=arr[i];
int curr_sum=arr[i];
for(int j=1;i<n;j++)
{
int index=(i+j)%2;
curr_sum+=arr[index];
curr_max=max(curr_max,curr_sum);
}
res=max(res,curr_max);
}
return res;
}
int main()
{
int arr[]={5,-2,3,4};
cout<<maxCircularSum(arr,4)<<endl;
return 0;
}//my this code is not executing idk why......any suggestions?
Pavel
Pavel
Not sure what "not running" mean. Let me check
Pavel
no but not even running
it runs but gets into an infinity loop
https://ideone.com/4voxq3
you have a copy-paste error in the second loop, in line 10 should be j<n instead i<n
Adarsh
Pavel
Anonymous
Someone
Is Relevel hiring by unacademy worth?
Mahdi
Hello book C++ What do you suggest
Which you actually exited.
Mahdi
Remembering pv
Anonymous
Can anyone share a pdf or something, to deeply understand the working of C++?
Like, linkers, header files, pre processors, in depth.
I know stuff but I wanna get more into it.
klimi
If it is legal, then people can share it...
Sasuke
Sasuke
Kartik
#include <iostream>
using namespace std;
void getdata(int a,float b);
void putdata();
class item
{
public :
int mobile,laptop;
private :
mobile = a;
laptop =b;
};
void item::getdata(int a,float b)
{
num=a;
cost=b;
}
void item::putdata ()
{
cout<<"number"<<num<<endl
<<"cost"<<cost<<endl;
}
int main()
{
obj m;
object.item= putdata();
object.item=getdata(int a,float b);
return 0;
}
Kartik
Pls help me
Kartik
There is a logical error
Kartik
I need this in college assignments
Golden Age Of
Kartik
Sir sorry but I am learning
Golden Age Of
Kartik
Thanks sir good to hear that
Golden Age Of
Read about constructors and destructors and getters/ setters.
Also you should know that class or struct is your personal data type as int, double etc. And you can operate with it any way you need, every time you create the OBJECT of your CLASS, you create a member with certain variables and functions.
Kartik
So by default class is accessible to public
Kartik
Can I show you the
Kartik
Error which i encountered in the mobile ide
Golden Age Of
Golden Age Of
Are you trolling us here?
Golden Age Of
I'm just messed up a bit?
z
/report
Kartik
Kartik
I'M using dev cpp and vs code
Kartik
Mobile ide?
Sorry sir I am saying that is in dev cpp
Kartik
Ok sir this will took time if I do it myself and refers to book