« first day (183 days earlier)      last day (2661 days later) » 

1:31 AM
can someone please answer this?
In operator(), make it return xxxx(str1, str2) < 0;Igor Tandetnik Jan 1 at 16:05
0
Q: Comparator case insensitive string set

Kartik VI was just checking effective STL(book) example for set comparator to implement case insensitive set, but i am facing problems(visual studio says comaparator not valid but it worked in ideone). I am sure there is something wrong in my implementation even then it is little confusing what is right....

 
3 messages moved from Lounge<C++>
 
 
3 hours later…
5:04 AM
@KartikV I'm not sure what question are you asking. Is it:
> im confused as to what makes a comparator valid
 
5:15 AM
"how I was supposed to know?" well it's linked to in the cppreference docs for std::set
 
5:49 AM
hi millen
 
 
4 hours later…
9:37 AM
If I define my 7 bit field like this

struct bits {
unsigned int a:1;
unsigned int b:1;
unsigned int c:1;
unsigned int d:1;
unsigned int e:1;
unsigned int f:1;
unsigned int g:1;
};

How would I assign value 30 to this bit set?
 
1 message moved from Lounge<C++>
 
a union, or decompose the value into individual bits
 
Can you please show some examples
 
@Geetha you wouldn't
the bits are bits, the numbers are numbers
 
Now I need to represent value 30 in 7 bit field. How can I do that
 
9:41 AM
btw. have you seen this question
1533
Q: How do you set, clear and toggle a single bit in C/C++?

JeffVHow do I set, clear and toggle a bit in C/C++?

 
if I convert number 30 to binary format and represent that in that bit set. Would that be correct?
11110 = 30. so the bit set a = 0, b = 0, c= 1, d= 1, e=1, f=1, g=0
answer please
 
while you could do that, you'd rather do bitmasks instead with unsigned numbers
unsigned x = 30; and then extract the individual bits like the accepted answer in the above question does
 
is it unsigned int x = 30?
Also How can I extract individual bits
 
unsigned and unsigned int are the same thing
2386
A: How do you set, clear and toggle a single bit in C/C++?

Jeremy RutenSetting a bit Use the bitwise OR operator (|) to set a bit. number |= 1 << x; That will set bit x. Clearing a bit Use the bitwise AND operator (&) to clear a bit. number &= ~(1 << x); That will clear bit x. You must invert the bit string with the bitwise NOT operator (~), then AND it. T...

 
x & (1<<i) where i changes from 0 to 7
if the result is 0 then the bit is zero if the result is not 0 then the bit is set
 
 
2 hours later…
user1593881
11:22 AM
Should one read Design Patterns gang of four book? How relevant is that 1994 book today and must one know all 20+ patterns if not in R&D?
 
dunno haven't read it
but if you decide to do so, take everything they say with a grain of salt
 
user1593881
I see.
 
ISTR one of the four authors admitted the singleton was a mistake not too long time ago in a talk, for example
 
Ven
"global variables are a mistake" – everyone, pretty much
 
patterns are just tools
do not make the mistake of thinking that you need to apply them to solve problems
instead they are some of the ways you can solve specific problems
 
user1593881
11:27 AM
I see. While in interview I was asked to code one of them, I replied I would have to look at UML diagram and then write it.
 
user1593881
I take it one should not know all of them by heart.
 
indeed
 
 
2 hours later…
Ven
1:15 PM
I'd say one should not use them
 
 
4 hours later…
5:22 PM
I have a strange question
I'm debugging code in VS2010, and I'm running into a weird memory access violation
I have a function call destroy_param(&param), which frees memory. Before the call, param has a bunch of pointers pointing to 0x00000000, which the function will ignore. However, once it is called, one of param's members now points to a bad location
 
3 messages moved from Lounge<C++>
 
@mmf1102 it's 2017, JFYI
 
I am aware, but we are using VS2010. That's not really the point here
 
@mmf1102 The error is on line 42.
 
Isn't everything? @JerryCoffin
 
5:26 PM
Good evening...
 
@mmf1102 No, not everything is on line 42. If everything was on that line, it would be line 1, not 42.
 
@ArthurP.R. certainly
 
it is
Someone having experience with using visual studio code on linux?
 
lol linux
 
Seems like someone doesn't take Linux for serious
 
5:28 PM
@ArthurP.R. for C++?
 
@Abyx Indeed
 
I prefer SublimeText on Windows.
for almost everything
hth
 
@Abyx Interesting
Thank you very much for this information
 
This is so bizarre
 
welp I recon VS Code should be mostly alright for editing C++ code.
 
5:33 PM
I'm asking because I really like Visual Studio on Windows. However it isn't available for Linux. There's only Visual Studio Code which I don't know really well. I'd like to use it as IDE :S
 
@ArthurP.R. For Linux, I tend to recommend JUCi++. It's not as good, but at least it's not nearly as terrible as most Linux alternatives.
 
nwp
Qt Creator is relatively decent.
 
@JerryCoffin That's exactly what I experienced so far on Linux haha :D
 
seconding juCi++ recommendation
it's more than meets the eye
 
@nwp I've never been able to quite figure out why, but I've never been able to warm to Qt Creator. I've used it a few times, and it certainly works, but reasons of which I'm completely uncertain, I've always disliked it anyway.
 
5:40 PM
This IDE seems to be nice enough. Look's like you can work with it :D
Look at this:
It's so nice :D
 
That's beautiful
 
So Visual Studio Code is still not ready to be used as IDE on Linux ._. ? That's poor if so
 
despite the name, it's not related to Visual Studio
it's only a text editor
competition to Atom
 
What about this ._. ?
https://code.visualstudio.com/docs/languages/cpp
 
what about it
I don't see refactoring support anywhere
can you call this an IDE
also: Vim has plugins, Emacs has plugins, Sublime Text 3 has plugins, Atom has plugins...
if you integrate stuff into your text editor then you might get something that resembles an Integrated Development Environment
 
6:00 PM
SublimeText can resemble a IDE
However, thanks! :) I'll keep a look on JUCi++
 
nwp
6:19 PM
@JerryCoffin Maybe it is because it is ugly as hell. A Qt dev once said Qt Creator is for people who hate IDEs.
But it has enough features that one can use it productively and not enough flaws that competition has enough of an edge to switch.
Though I do hope that with the rise of libclang more features will emerge.
 
7:02 PM
I have a question
Can I ask over here
 
No, ask it over there
 
I want to develop program an advanced program in C++
 
that's not a question
 
Actually no one is answering there@Abyx
let me write down
 
oh damn
 
7:03 PM
I am typing
I am using Digisol 3G Dongle(DG-BA3370). The software which came along with it has the feature to recieve and do outgoing call/sms.
I want to develop a software which will automatically call the person when sms from any person(any number) is recived.
Actually I want to broadcast a audio file to all the persons who sms me(which I will do by using output of speakers of my pc as input to reciever of pc through a alerady built software).

So can anyone tell the inbuilt functions in C++ which I can use to call a user using my dongle
Do anyone know this??
 
@HNSingh there are no such inbuilt functions. Read the programming manual for that dongle.
 
There is a usage manual,but no programming manual
 
ask the manufacturer then
 
Do you think he will help me out
 
Certainly not.
 
7:08 PM
Then
So how can i program it
 
5 messages moved to Trash
 
@milleniumbug Thanks.
 
So anyone do have any idea of my question?
 
no one here owns a "Digisol 3G Dongle(DG-BA3370)"
this functionality is device specific. if you don't have API docs, get them
you can't start working on it otherwise
 
7:23 PM
@HNSingh Assuming it's a USB dongle, you can probably use a USB analyzer to examine what goes over the bus to/from the dongle during a transaction. Imitate that sufficiently accurately, and you're on your way.
@nwp I once used (and liked) Microsoft's old "Programmer's Work Bench", which was a text-mode IDE, and about as ugly as things get (but also quite functional--in some ways VS is still behind what it did decades ago).
 

« first day (183 days earlier)      last day (2661 days later) »