Hamid
You must put it inside { }
Anonymous
Really?
Anonymous
That's how it is?
Hamid
Anonymous
No it's not. I've seen it being used for char
Anonymous
Like for operations
Hamid
'area' is not acceptable as a char
Anonymous
Anonymous
Hamid
Does this code even compile? 😐
Anonymous
I'll try
Anonymous
Thanks
Andrew
Anonymous
Anonymous
Anonymous
Anonymous
Anonymous
Andrew
Press 1? Press 2? How is that?
instead of this Enter desired objective. choose from either circumference or area\n this press (1) to get circumference , (2) area
Anonymous
Oh so I should replace the case 'circumference' and case 'area' with press 1 or 2
Andrew
yh
Anonymous
I mean with 1 or 2 like
case 1
case 2
Anonymous
Andrew
Anonymous
yes
Ooh. Okay thank you very much.
Anonymous
So if my switch is more than one line what should I do?
Anonymous
Right?
Anonymous
Okay
Anonymous
plz
Anonymous
can i any one help me
Anonymous
Write a program to print menu as in (a) from printMenu() function. Then write a function,
called simpleCalculator(). In the function, request the user to input two real numbers and
one of the letter codes A, S, M, D or L. Based on the code entered by the user, the program needs
to perform an appropriate arithmetic operation to the two numbers. Then, display the result of
the operation. The letter codes and their operations are as listed below:------------------------------------------------
Simple Calculator Program
---------------------------------------------------
A - Addition
S - Subtraction
M - Multiplication
D - Division
---------------------------------------------------
Anonymous
??????????
Andrew
Anonymous
the program needs
to perform an appropriate arithmetic operation to the two numbers. Then, display the result of
the operation
Anonymous
Vlad
Vlad
Go do it
Anonymous
????
Andrew
you know how to make a function to sum 2 numbers?
Vlad
????
It would take you like an hour if you've never programmed before
Vlad
Maybe less. Depends how much are you gonna fight with syntax lmao
Anonymous
i know i want some help only
Vlad
i know i want some help only
We won't do it for you. It is C++ chat. Why would we advise you to not learn C++ and just get a solution?
Vlad
/report
Andrew
im curios is there a way to print all variables name in the scope like
int main(){
int var1;
int var2;
int var3;
printScopeVariables(); //outputs ->(var1, var2, var3)
}
Andrew
like there should be a place in memory where the variable names are saved, or they are discarded at compile time?
Pavel
More so, if you compile with optimizations enabled, the values of the variables can no longer exist in memory (they can become a part of assembly commands if they were constants, be stored directly in registers if their necessary lifetime is short, or be optimized in some way)
Andrew
thanks
Andrew
make sense
Sunil
#include<stdio.h>
int main()
{
printf("%x", -1<<1);
getchar();
return 0;
}
Sunil
Guys can u explain
Ehsan
Ehsan
shift -1 in binary representation to the left
Ehsan
Sunil
Sunil
Sunil
# include <stdio.h>
# define scanf "%s Geeks For Geeks "
main()
{
printf(scanf, scanf);
getchar();
return 0;
}
Sunil
Output: %s Geeks For Geeks Geeks For Geeks
Sunil
How is this
Ehsan
Abhishek
Abhishek
Can anybody share some good resource for learning STL
Vitalii
Sorry, how to fix that warning?:
int row = 5, cols = 3;
double* matrixC = new double[cols];
for (int i = 0; i < cols; ++i) {
matrixC[i] = 0;
for (int j = 0; j < rows; ++j) {
matrixC[i] += matrixA[j][i] * matrixB[j];
}
}
matrixY[0] = matrixC[0] / matrixL[0][0];
matrixY[1] = (matrixC[1] - matrixL[1][0] * matrixY[0]) / matrixL[1][1]; // warning here: Reading invalid data from "matrixC": readable size is "cols * 8" bytes, but only "16" bytes can be read
matrixY[2] = (matrixC[2] - matrixL[2][1] * matrixY[1] - matrixL[2][0] * matrixY[0]) / matrixL[2][2];
Anonymous
if B::K is found in B, and i link A to B and C to A, and C uses B::K, then the linker SHOULD search A for B::K, be unable to find it, and then search A's dependancy of B, for B::K and find it, right?
as i get unknown reference if i link A against B and C against A
and i DONT get unknown reference if i link C against BOTH A and B EXPLICITLY
like wtf ;-;
eg
target_link_libraries(A B)
target_link_libraries(C A)
/* fails with unknown reference B::K */
target_link_libraries(C A B)
/* works */
Anonymous
imma just add this instead
message(STATUS "in ${CMAKE_CURRENT_LIST_FILE}:")
message(STATUS " please remember to add `import_library__AndroidDAW_Midi()`")
message(STATUS " after `import_library__AndroidDAW_Plugin()`")
message(STATUS " (or before if you are alphabetical ordering)")
message(STATUS " and then link to `AndroidDAW_Midi`")
Liam
@MRT_1400
template <typename T>
struct Singleton {
static T* get() {
static T ins;
return &ins;
}
T* operator->() const {
return get();
}
};
using:
Singleton<Payload>::get()->interface_of_payload();
or
Singleton<Payload>()->interface_of_payload();
MRT
static T ins; ?
MRT
Liam