coal
because some libraries might depend in the other
coal
so linking is done right to left in order of importance, where right-most libraries dont depend in anything
Leovan
coal
yw
coal
if you're under linux you can prepend a shebang specifying the interpreter for the contents of the file
coal
if you're under windows you cant unless you directly or indirectly run it using the correct interpreter
coal
if you mean an actual executable file then you need to know how to write compilers
M
/getcbook
lion
Hi Guys,
Good morning,
I am just beginning to learn C programming language since last week.
Can anyone say something that which timeframe should i allocate for a day.
Between i really interesting on learning void main () now which i have been focussing from scratch?
lion
Any suggestions/comments would be very welcome and appreciated
Vala
C# Login error dt
%Nikita
alice
program that asks the user to enter the parameter 1 tand an upper limit of the stochastic variableXwhich the probability is to be calculated for, and which draws the Poisson distribution based on this information.
Run the program with a number of different values for At, and notice how the Poisson distribution begins to resemble a normal distribution when the value of the parameter Aincreases.
alice
please need help
Pavel
.
Can some one help how to decript Ransom ware virus!!?
klimi
MᏫᎻᎯᎷᎷᎬᎠ
.
.
.cuag
.
Online encrypted
klimi
i see, you are not trying to code decryptor :D
.
I am beginner 1st year so can u help me plzz?
Anonymous
I am begginer if C++
What shall I do
Anonymous
.
I have decripted local disk c and cant decript d and e
Rojal
Any one can help me to decrypt .BOOA
Pritam
Hi
Pritam
Anyone interested in online Coding Cotest?
Azhar
cout << carObj1.brand << " " << carObj1.model << " " << carObj1.year << "\n";
  cout << carObj2.brand << " " << carObj2.model << " " << carObj2.year << "\n";
I want to reduce code, want to print two object with single line of code ...how can i ?
Anonymous
coal
coal
if you google a bit, you'll find something like this: https://www.geeksforgeeks.org/overloading-stream-insertion-operators-c/amp/
Azhar
coal
coal
but you'll save the need to print model and year individually
coal
you'll just std::cout << carObj and done
coal
if you want to print both objects, just do:
std::cout << carObj1 << std::endl;
std::cout << carObj2 << std::endl;
Azhar
Arnold
you need to define what the << operator will do for the class
Arnold
operator overloading
Arnold
but don't bother, it's not too much code...
Anonymous
Anonymous
include<iostream>
using namespace std;
class Complex {
private:
int real, imag;
public:
Complex(int r = 0, int i = 0) {real = r; imag = i;}
// This is automatically called when '+' is used with
// between two Complex objects
Complex operator + (Complex const &obj) {
Complex res;
res.real = real + obj.real;
res.imag = imag + obj.imag;
return res;
}
void print() { cout << real << " + i" << imag << '\n'; }
};
int main()
{
Complex c1(10, 5), c2(2, 4);
Complex c3 = c1 + c2;
c3.print();
}
Anonymous
Anonymous
Please please
Harleen
Hello,
I am trying to compile the code but I don't understand what is wrong. I am using Windows subsystem for linux.
gcc ‑‑std=c++11 task1.cpp cat.cpp ‑lstdc++ ‑o task1
ERROR:
gcc: error: ‑‑std=c++11: No such file or directory
gcc: error: ‑lstdc++: No such file or directory
gcc: error: ‑o: No such file or directory
gcc: error: task1: No such file or directory
\Device\NUL
\Device\NUL
Also, the correct parameter is -std=c++11 , but i prefer using -pedantic
Azhar
Constructor will help you
I have knowledge of constructor but is it possible to copy class and print with multiple objects without calling each time , like we do in daily life?
Sanket
Krishnaa
vector<int> x;
vector <int> preorder(Node* temp)
{
vector<int> p;
if(temp==NULL) return p;
x.push_back(temp->data);
preorder(temp->left);
preorder(temp->right);
return x;
// Your code here
}
Krishnaa
Why this code snippet doesn't work for PreOrder Traversal in GFG practice???????
Krishnaa
Ravi
Why this code snippet doesn't work for PreOrder Traversal in GFG practice???????
Your code will be fail during backtracking when temp==NULL ..... This GFG problem is not for recursive approach you have to go with iteration approach and if you want to go with recursion then this will help u out....
void preOrder(Node* root,vector <int> &v)
{
if(root != NULL)
{
v.push_back(root->data);
preOrder(root->left,v);
preOrder(root->right,v);
}
}
vector <int> preorder(Node* root)
{
// Your code here
vector <int> res;
preOrder(root,res);
return res;
}
Krishnaa
Distac_221
hello, can you guys help me to improve this code, and whats your suggestion with this code
https://pastebin.com/L0rSddE9
klimi
Also when someone enters longer name, the newline character won't be print
klimi
You could fix this by reading the return value of fgets and setting newline on your own, or have some check if more data is coming
klimi
https://en.cppreference.com/w/c/io/fgets
Distac_221
klimi
well that is on your how you choose to implement it
klimi
you could just forcefully put the str[n-2] to a newline character
klimi
but that could not work all the time
klimi
it would be better to think what cases can occur and how to deal with them
Distac_221
thank you
klimi
no problem
Distac_221
no problem
i was just try to ask if someone doesn't input anything how do i give the message
klimi
Distac_221
why its always give "please input your name" even if i gave input
https://pastebin.com/asz0rrp9
Hima
Distac_221