\Device\NUL
Ssssss
#include <iostream>
using namespace std;
class BankDeposit
{
int principal;
int years;
float interestRate;
float returnValue;
public:
BankDeposit();
BankDeposit(int p, int y, float ir);
BankDeposit(int p, int y, int ir);
void display();
};
BankDeposit::BankDeposit()
{
cout << "you are bankrupt mf " << endl;
}
BankDeposit::BankDeposit(int p, int y, int ir)
{
principal = p;
years = y;
interestRate = float(ir) / 100;
returnValue = principal;
for (int i = 1; i <= years; i++)
returnValue = returnValue * (1 + interestRate);
}
BankDeposit::BankDeposit(int p, int y, float IR)
{
principal = p;
years = y;
interestRate = IR;
returnValue = principal;
for (int i = 1; i <= years; i++)
returnValue = returnValue * (1 + interestRate);
}
void BankDeposit::display()
{
cout << "return value of your amount " << principal << " in "
<< years << " years will be " << returnValue;
}
int main()
{
BankDeposit b1;
BankDeposit b2(100, 2, 4);
b2.display();
BankDeposit b3(100, 3, 0.04);
b3.display();
return 0;
}
Ssssss
redefinition of 'BankDeposit::BankDeposit(int, int, int)'
klimi
Ssssss
\Device\NUL
klimi
yes
klimi
and you call it with double
klimi
but you don't have double variant
{ЅᎯⅅⅅ-ℰ}
is it nested loop ?
With for loop business I have my question whether it works with while loop.
Each digit should be displayed as often as it is.
So
1
22
333
4444
{ЅᎯⅅⅅ-ℰ}
klimi
klimi
note the f
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
Oh, that's why they do it.
Ssssss
Ludovic 'Archivist'
Talula
Antonio
Hi everyone, I need a lot of help with this task, I have created my client and server but it seems that my code has several things that do not work, these are the requests to be fulfilled for the task "Link in pvt " , if you can help me contact me in pvt
Antonio
the programming language used is c
Кто-то
Hello. Do I need to mark the variables in this function as const?
bool testTriangleBBoxIntersect(const bbox& b, Plane p)
{
glm::vec3 c = (b.max + b.min) * 0.5f;
glm::vec3 e = b.max - c;
float r = e.x * std::abs(p.n.x) + e.y * std::abs(p.n.y) + e.z * std::abs(p.n.z);
float s = glm::dot(p.n, c) - p.d;
return std::abs(s) <= r;
}
Captain
Кто-то
Captain
Depends on you, your logic
Pavel
I mean local variables (c, e, r, s)
If you don't intend to change them, mark as const, nobody will be hurt by that but the compiler will check that this intention is not changed
Peace
What is self type in C++ ?
Prabhat
Antonio
Anyone can help me with tcp client/server calculator in c?
klimi
indeed it has to be written in English but... it still seems that it is just some assignment from some school...
Anonymous
Captain
Anonymous
Hi Guys I have a some questions
I have a some ardunios code how can I convert STM 32 from ardunio. I couldn't find any converter on the internet for this
Anton
Hi everyone. I have a function foobar(n) that executes another function based on integer type.
Is following construction possible in C? If yes, how can I detect which type n belongs to?
Pseudo code:
void foobar(n)
{
if (typeof(n) == int)
foo(n);
else if (typeof(n) == unsigned int)
bar(n);
}
int main(void)
{
int a;
foobar(a);
unsigned int b;
foobar(n)
return (0);
}
\Device\NUL
Anton
Thanks! The main question rather how foobar(n) function should be prototyped to take any integer type, so that it could work with n later on.
\Device\NUL
Ludovic 'Archivist'
Ludovic 'Archivist'
They also generally lack static reflection
Ludovic 'Archivist'
Anton
Anton
Ludovic 'Archivist'
While a lot of programming languages are defined by their implementation, that is rarely the case for older languages like C, C++, lisp flavours... Where instead implementations follow a more or less vague guide book
Ludovic 'Archivist'
And that guide book says, for C and C++, that anything starting with __ may or may not cause demons and pixies flying out of your nose
Ludovic 'Archivist'
olli
Ludovic 'Archivist'
Ah my bad then
olli
tbf I don't like it, but it was the attempt to bring Generics to C....
Ludovic 'Archivist'
Ehsan
Anton
Ludovic 'Archivist'
Nomid Íkorni-Sciurus
Hi guys I have an issue with this procedure:
HWND Container::createWindow(void) const {
int width = CLASSNAME_APP_MIN_WIDTH;
int height = CLASSNAME_APP_MIN_HEIGHT;
auto parentHandle = this->getParent()->getHWND();
auto hInstance = this->getInstance();
return ::CreateWindow(
_T(CLASSNAME_CONTAINER),
nullptr,
WS_CHILD,
0, 0,
width, height,
parentHandle,
nullptr,
hInstance,
nullptr
);
}
The debugger says that CreateWindowW is trying to call a null pointer to a function deep inside user32.dll
I guess some of the parameters are wrong.
I know for sure that:
1. parentHandle comes from the hwnd parameter of WM_CREATE ;
2. hInstance is valid
3. the other nullptr s are not the issue.
What would you suggest?
Jagadeesh
#include<stdio.h>
int main(){
int a = 178;
char *ptr;
ptr =( char *)&a;
printf("%d ",*ptr);
return 0;
}
how it's printing -78
\Device\NUL
\Device\NUL
Max value of signed char is 127, 2 ^ 7
\Device\NUL
Data type overflow i think
Jagadeesh
okay
Ammar
Ammar
\Device\NUL
Is there any specific reason to declare variable outside loop beside compability with ANSI C (C89) ?
type i;
for (i = n; ;)
for (type i = n; ;)
Ammar
/report
Phoenix
Guys can any 1 help me out here?
I was trying to swap two numbers using this
#include<iostream>
using namespace std;
void swapNums(int,int);
int main()
{
int a=10,b=20;
cout<<"before swap value of a is "<<a<<" and value of b is "<<b<<endl;
swapNums(a,b);
cout<<"after swap value of a is "<<a<<" and value of b is "<<b<<endl;
return 0;
}
void swapNums(int x,int y)
{
int z=x;
x=y;
y=z;
}
Output:
before swap value of a is 10 and value of b is 20
After swap value of a is *10* and value of b is *20*.
But why is this happening even when i called the function inside main function?
\Device\NUL
Phoenix
Nope
\Device\NUL