Laopigo
Nameful
Egro
Push_back()
Dumb this down please
Egro
The definition is weird, saying to push back one element to a vector , while it is actually adding an extra element to a vector.
Should it be define as : adding an extra element to the end of a vector
?
Anonymous
Hello, Can anyone have C4droid app for coding? If anyone have please share to me....
klimi
\Device\NUL
D
Bereket
Anonymous
#includes <stdio.h >
#includes <stdlib.h>
#includes <math.h>
# define pi 3.14
double w0=1.0, w=1.0, f1=0.0,a=0.0;
double f(double t , double theta ,double v) { return v;}
double g(double t,double theta ,double v )
{return -pow(w0,2)*sin(theta )-a*v*f1*cos(w*t);}
int main()
{
double h=0.01, t=0.0, a=0.0 , v=0.0 ;
double T=2*pi/w0 ,Tobs =3*T ,theta =pi/5 ;
FILE*fp;
fp=fopen("pendule_simple1.dat", "w");
while (t<=Tobs)
{ v=v+h*g(t,theta,v);
theta=theta+h*f(t,theta,v);
printf("%.16lf\t %.16lf\n",theta,v);
fprintf(fp,"%.16lf \t %.16lf\n",theta,v);
t=t+h;
}
fclose(fp);
return 0;
}
/* run
undefined reference to 'pow'
undefined reference to 'sin'
undefined reference to 'cos'*/
// where is error in this code ???
return 0;
}
Define pi in capital i.e PI
Hanz
maybe that's the case, i never know any compiler generalize that
Dastan
how to make own c++ compiler?
Anonymous
Ammar
Macro is not always capital, you can use lower case to define a macro of course.
And also
#define aaaa
and
# define aaaa
are the same thing, the space after the hashtag # does not matter.
Anonymous
Hanz
Ammar
#includes <stdio.h >
#includes <stdlib.h>
#includes <math.h>
# define pi 3.14
double w0=1.0, w=1.0, f1=0.0,a=0.0;
double f(double t , double theta ,double v) { return v;}
double g(double t,double theta ,double v )
{return -pow(w0,2)*sin(theta )-a*v*f1*cos(w*t);}
int main()
{
double h=0.01, t=0.0, a=0.0 , v=0.0 ;
double T=2*pi/w0 ,Tobs =3*T ,theta =pi/5 ;
FILE*fp;
fp=fopen("pendule_simple1.dat", "w");
while (t<=Tobs)
{ v=v+h*g(t,theta,v);
theta=theta+h*f(t,theta,v);
printf("%.16lf\t %.16lf\n",theta,v);
fprintf(fp,"%.16lf \t %.16lf\n",theta,v);
t=t+h;
}
fclose(fp);
return 0;
}
/* run
undefined reference to 'pow'
undefined reference to 'sin'
undefined reference to 'cos'*/
// where is error in this code ???
return 0;
}
Maybe the invalid part is #includes
Ammar
That should be #include.
Anonymous
Then what should be the problem
Hanz
Dastan
Dastan
Dastan
Sileno
How to debug a external process using Clion and Attach to Process. I try, an error appears and it doesn't work: "com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: ptrace: Operação não permitida.
Debugger detached"
ɛ n h ᴀ n c ɛ ґ 🧟♂️
Can someone please write me a code to remove duplicates from a string
klimi
need more context, what system are you using? what compiler?
ɛ n h ᴀ n c ɛ ґ 🧟♂️
Anonymous
Please I want code that can do something like this
Anonymous
Input: n = 3
Output:
012 013 014 015 016 017 018 019 023 024 025 026 027 028 029 034
035 036 037 038 039 045 046 047 048 049 056 057 058 059 067 068
069 078 079 089 123 124 125 126 127 128 129 134 135 136 137 138
139 145 146 147 148 149 156 157 158 159 167 168 169 178 179 189
234 235 236 237 238 239 245 246 247 248 249 256 257 258 259 267
268 269 278 279 289 345 346 347 348 349 356 357 358 359 367 368
369 378 379 389 456 457 458 459 467 468 469 478 479 489 567 568
569 578 579 589 678 679 689 789
Anonymous
Even if I increase n
Anonymous
To 8
Anonymous
I have done some work on it but it is not giving me what I want
Otumian
What is the output when n = 1
Іван
hi, how can I output the result of void function in textBox? textBox5-> Text = .... (what's next?)
klimi
result of void? void does not have any output
Golden Age Of
tim
tim
for real you should use double
Golden Age Of
no no no
Oh, I didn't read above, I just said about some words
Golden Age Of
Golden Age Of
Golden Age Of
klimi
:(
if you want to return something... use other data type
olli
ɛ n h ᴀ n c ɛ ґ 🧟♂️
Кто-то
I'm implementing octree data structure. In octants i store triangles. So question: When i need to to stop dividing octants in Octree? I think about max depth or number of max number of triangles in octant, but how i can calculate this values?
ɛ n h ᴀ n c ɛ ґ 🧟♂️
drinktoomuch
can we have a function in function in c++ ?
drinktoomuch
hmmm thank you for your suggestion
មួង អាទិត្យឆវ័ន្ត
hmmm thank you for your suggestion
this's exmaple
auto sum = [](){ int a = 5;
int b = 10;
return a + b;};
or
int a = 5;
int b = 10;
auto sum = [=](){return a + b;};
GandolfAF
I tried posting but it was deleted. Gist is I keep getting this error despite research and trying different paths. OS is recent version of OS X. Using the cktan/tomlcpp library and it's installed via make and make install. LD_LIBRARY_PATH didn't fix it. Dropping the files into the project dir didn't clear the error either. I am at a loss, as is google. Repo on github at tsasser05/cryptoTracker
Any ideas what I should do to get the compiler to find the TOML lib?
└─ ▶ g++ main.cpp Transaction.cpp Coin.cpp -o coin -std=c++17 -Wall -I/usr/local/lib/ -I/usr/local/include
Undefined symbols for architecture x86_64:
"toml::parseFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-a92e6a.o
"toml::Table::getTable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
_main in main-a92e6a.o
"toml::Table::getDouble(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
_main in main-a92e6a.o
"toml::Table::getString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
_main in main-a92e6a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
drinktoomuch
Anonymous
Thank you Rose
Talula
Talula
Depends on what you want to do and depends on your budget.
Talula
Do you want to program Windows GUI / CLI or Web Server?
Talula
That was a question that couldn't be answered in "Ya, Yes"... so what are you planning to program, if you want to have good decent access to all 3 I would suggest go for Visual Studio Community Edition.
Talula
I didn't say Visual Studio Code... I said "Visual Studio Community Edition"... I'll send the link.
Talula
https://visualstudio.microsoft.com/downloads/
Puspam
Puspam
Talula
Please delete your code or you'll get a warning from Admin, it is not allowed to post code directly... you have to use pastebin