Karan Joshi
Hello
PRIYANSHY
HLOo
Talula
PRIYANSHY
hy
Anonymous
Anonymous
C supports gui?
Anunay
Anonymous
In which field C is widely used?
Talula
In which field C is widely used?
Hmm... none actually... C++ is used widely in Embedded, Core Programming, Core Gaming Logic, System level programming, etc... C... hmm... can't think of anything.
Anunay
Anunay
Linux ecosystem actually, not just the kernel
Talula
You don’t want it to go down when you press enter?
♧
Vikie
Hi
Talula
Yes
Then you have to use getch() and get each char till you get \n\r which you should ignore and not display.
♧
Ok, thank you!
holin
Excuse me, may you all have a great day. I want to know is one of you understood or advanced in data structures such as linked list, stack, and queue in C language? Let me know please i need your help to finish my final project, thankyou 🙏🙂
Abhishek
holin
Sure
May i chat you privately? If you don't mind, there's 2 mini projects that'll need your help 🙏
Abhishek
vasu
guys, can anyone tell me how to use graphics.h in VSCode?
Hamid
hey everyone,
to be honest, i'm very new to cpp but i coded in python, js, ... before
what i'm trying to do is very simple. i wanna use someexternal libraries in "boost" library
i read some articles about how to link my cpp code with external libraries, but i got some undefined refrence to error when i trying to compile the code example in the docs of boost library
i use mingw with windows 10 64bit
#CPP #mingw #external_library
Hamid
this is the code that i enter in the powershell to compile my reg.cxx program
g++
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-d-x32-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-s-x64-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-sd-x64-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-x64-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-d-x64-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-s-x32-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-sd-x32-1_68.a
C:\mingw64\include\boost\lib\libboost_regex-mgw63-mt-x32-1_68.a
.\reg.cxx
-I C:\mingw64\include\boost\include\
Hamid
i also tried
g++
-L <PathToBoostLibFolder>
reg.cxx ...
but didn't work { gave me undifined refrence to error
Hamid
this is the code example in boost docs:
#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
int main()
{
string line;
boost::regex pat( "^x.*" );
while (cin)
{
getline(cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
cout << matches[2] << endl;
}
cout << "im done!";
}
Andrew
in the boost folder there is an hpp file?
Andrew
try to show the output of the compile
Andrew
are you using codeblocks?
Hamid
https://gist.github.com/hamidb80/9b93e1219803d769177f8f5eb3ddd801
Andrew
oh i think i understand
Andrew
you may be missing the flags
Hamid
Anonymous
Andrew
try adding this to the g++ command -lboost_regex
Andrew
Andrew
btw looking for your log, you also have to include the phtread lib
Hamid
try adding this -lboost_regex-gcc34-mt-d-1_36
it should find the libraries, right?
but i have no idea what's going on
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lboost_regex-mgw63-mt
collect2.exe: error: ld returned 1 exit status
here's the code
g++
-IC:\mingw64\include\boost\include\
-LC:\mingw64\include\boost\lib\
-lboost_regex-mgw63-mt
.\reg.cxx
Sabuhi
Hello
Sabuhi
#include <iostream>
#include <vector>
int main ()
{
std::vector<int>::size_type sz;
std::vector<int> foo;
sz = foo.capacity();
std::cout << "making foo grow:\n";
for (int i=0; i<100; ++i) {
foo.push_back(i);
if (sz!=foo.capacity()) {
sz = foo.capacity();
std::cout << "capacity changed: " << sz << '\n';
}
}
std::vector<int> bar;
sz = bar.capacity();
bar.reserve(100); // this is the only difference with foo above
std::cout << "making bar grow:\n";
for (int i=0; i<100; ++i) {
bar.push_back(i);
if (sz!=bar.capacity()) {
sz = bar.capacity();
std::cout << "capacity changed: " << sz << '\n';
}
}
return 0;
}
Sabuhi
Can anyone help me? Why in this code capacity is incresased by 2 by 2.
Serhat
/get
Sabuhi
Capacity incresased as powers of 2
Serhat
/get
Serhat
/get cbook
Andrew
Sabuhi
Ehsan
Pavel
Ehsan
Sherlock
I don't understand how both the operands get their value in an operator overloading please explain?
Anonymous
Hamid
Anonymous
i did
Then it's invalid. Simple
Anonymous
Hi👋
I want to learn about OS programming with C and Assembly.
What is best books for this?
Hamid
Ali
use cmake for simplicity
I too started learning C++ recently and saw many projects use cmake. Will definitely use cmake in coming days.
Ali
Am bit familiar with Makefile, not sure why cmake is popular with C++
Sherlock
??
**
Needed a help in writing a program to add one digit to a 4 digit number and *ignore the carry digit*
Sherlock
Anonymous
Hello
Anonymous
I have a code where I'm having trouble with
Anonymous
#define _USE_MATHS_DEFINES
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
//M_PI=3.1415926536
double radius,circumference,area;
char normal;
cout<<"Enter desired radius"<<endl;
cin>>radius;
cout<<"Enter desired objective. choose from either circumference or area\n";
cin>>normal;
switch(normal)
{
case 'circumference':
circumference=double(normal);
cout<<"The answer is\n"<<radius*M_PI*2;
break;
case 'area':
area=double(normal);
cout<<"The answer is\n"<<radius*M_PI*M_PI;
break;
default:
cout<<"Don't know how to help you. Sorry!"<<endl;
break;
}
return 0;
Anonymous
It won't work the way I'm intending
Hamid
Anonymous
It prints my default case
Anonymous
All the time