Anonymous
Using inline functions for this purpose is not
Harsh
Inline probably means substitution, instead of requesting memory from function stack
Harsh
Yes
Harsh
Try a macro like #define square(x) x*x And use it like cout << square(1+2) ; You'll know
Harsh
An actual function will return the square of 3 Macro defined like this won't
Anonymous
That was the point
Harsh
That's a fix. I'm talking about the way it operates. Mine will compute 1+2*1+2 Yours will use (1+2)*(1+2)
Anonymous
> also they are pasted in the place where they... ^^^^^^^^^^^^^^^^^^^^^^^ your answer is literally in line of the message you posted (pun intended)
Marián
close but not it
Marián
proobaaaably
Marián
i bet there was a specific term to express this tho
Marián
😄 thanks anyways ❤️
Alex
interface is not type
Anonymous
interface is not type
It's a type..
Anonymous
In C#, Java
Alex
An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class.
Alex
in C: An interface is simply a collection of functions that describe the behavior of the Object in some aspect. The interface itself does not implement any functionality, it just defines what methods the Object must have, and behave according to it. In some design methods this is called a contract for the Object.
Alex
In C#, Java
not related
Alex
look to the name of your group please
Anonymous
DARK
I'm completely new to coding
DARK
Can anyone help me to get started
Alex
no
Anonymous
I'm completely new to coding
If you have your full day for coding.. Go with C. And if you have your college or study stress or any job pressure go with Python.. Both the languages make your coding basics clear
kartik
/*simple interet program */ /*date9/25/2020*/ #include<stdio.h> int main() { int p,n; float r,si; p=1000; n=3; r.8.5; /*formula for simple interest*/ si = p * n * r /100; printf("%f\n",si"); return 0; }
kartik
getting error in above code
kartik
Check r=8.5
change the value
kartik
to 8
kartik
?
kartik
it's work
Rakesh
Check it
kartik
S G:\> cd "g:\code-for-c\" ; if ($?) { gcc code1.c -o code1 } ; if ($?) { .\code1 } code1.c: In function 'main': code1.c:14:19: warning: missing terminating " character printf("%f\n",si"); ^ code1.c:14:19: error: missing terminating " character printf("%f\n",si"); ^~~ code1.c:15:3: error: expected ')' before 'return'
Jackson
Hello there!
Jackson
How long to learn C++?
Alex
all life
Jackson
🤨
Jackson
What I can do with C++?
Jackson
Can I write a Android App?
Vlad
What I can do with C++?
E V E R Y T H I N G
Jackson
What is the disadvantages of C++?
Jackson
Can I write a iOS app via write C++ code?
Vlad
Silly questions flood gate was opened? :P
Alex
What is the disadvantages of C++?
the hardest language among popular, not compact, lots or design drawbacks(C approach combines with modern C++, same task can be accomplished different ways)
Jackson
OK, I Know it. C++ is more raw than other language.
Jackson
I am just test whether you guys know C++, hhaha!
Jackson
Got you!
Jackson
Yo Ho!
Jackson
I write code many years.
Vlad
I write code many years.
Yet your questions are still silly
Jackson
Yes, you are right!
Jackson
Thanks for your pride! Serious Guy,hahah!
Jackson
Your avatar is you? Look so cool.
Jackson
Jackson
Old meme: anything is type in JS.
Jackson
Old mem and yet cold meme, lol.
Indolent
how would you add an int to a string?
Jackson
how would you add an int to a string?
I don't know what you means actually. INT and STRING are both data type.
Indolent
#include <iostream> #include <vector> using namespace std; // psf = Paths so far void sol(int sr, int sc, int dr, int dc, string psf) { if(sr == dr && sc == dc) { cout << psf << endl; return; } for(int ms = 1; ms <= dc - sc; ms++) { sol(sr, sc + ms, dr, dc, psf + "h" + ms); } for(int ms = 1; ms <= dr - sr; ms++) { sol(sr + ms, sc, dr, dc, psf + "v" + ms); } for(int ms = 1; ms <= dc - sc && ms <= dr - sr; ms++) { sol(sr + ms, sc + ms, dr, dc, psf + "d" + ms); } } int main() { int x, y; cin >> x >> y; sol(1, 1, x, y, ""); return 0; }
Indolent
Make this thing run, its not going into production so dont worry about the beauty and all, just make it run somehow
Indolent
sol(sr, sc + ms, dr, dc, psf + "h" + ms); Make this line work somehow
J
What isn't working about it?
Indolent
that "h" + ms
Indolent
(probably)
J
Well, what does the compiler tell you?
Jackson
You must know that C++ is a statically compiled language, the memory is allocated after the code is written.
Indolent
no match for ‘operator+’ (operand types are ‘std::basic_string’ and ‘int’)
Jackson
INT type data length is different than STRING type, so your code is not rigorous.
Jackson
just validate the type before call the function.
Anonymous
You must know that C++ is a statically compiled language, the memory is allocated after the code is written.
> the memory is allocated after the code is written I think every programming language has this feature..
Anonymous
Nope
Lol
Indolent
Can you add that to my code? Please?
Jackson
Lol
Some language is dynamic, like JS
Jackson
So in JS, one type can change to another type when the code is running.
Anonymous
Some language is dynamic, like JS
In any case the memory for execution will be allocated after I WROTE the code