« first day (291 days earlier)      last day (4650 days later) » 

Run nm on the resulting executable, and you'll see.
 
@Mahesh if you want methods in a C struct you'll need to build your own vtable
 
Yeah, with function pointers and very unsafe things
 
The extern "C" line tells the compiler that the external information sent to the linker should use C calling conventions and name mangling (e.g., preceded by a single underscore)
 
Doesn't extern "C" means the code that follows have c linkage ?
 
8:02 PM
yes
 
@CodeMonkey k
 
@Mahesh It's the same as if you were to do name overloading in C++, it doesn't work in C so you can't make struct method's callable by a C Program
@Mahesh But I have asked on SO anyways to make sure my understanding is correct
 
So, gcc compiles the code but while linking we are asking that particular piece of code to have C linkage. But what is the advantage of it ?
@CodeMonkey Thanks
 
@Mahesh Well you can include a non-system header file using extern C in a C++ program
 
@Mahesh That C can link your code? That can be an advantage if... C will link to your code, this is specially meaningful for libraries
 
8:08 PM
But how can C link to that code? The struct has a member function.
 
1
Q: extern C and struct method

Code MonkeyGiven the following C++ code, #ifdef __cplusplus extern "C" { #endif struct foo { void getNum() { } }; #ifdef __cplusplus } #endif int main (int argc, char * const argv[]) { return 0 ; } Is it possible to call getNum() from C?

 
@MartinhoFernandes AFAIK, classes, structs, etc do not live inside the struct, class at all
so class x { int a; int c(); } will have sizeof(x) = sizeof(int) in this case
 
But what will be the C name of that member function?
 
@MartinhoFernandes A C language linkage is ignored for the names of class members and the member function type of class member functions.
 
How do you call it from C? If you can't, it's hardly useful.
 
8:13 PM
maybe you won't be able to call it
I really don't know
 
Rule of thumb: If it has C++ language linkage, it can't be exposed to C
that's what I gather...
 
What about overloaded free functions?
 
probably would not compile with extern C
 
C does not support name overloading
 
since they would have the same name
 
8:15 PM
C doesn't have overloading which is really sucky.
 
C1X could introduce that IMO
it breaks nothing
 
there's a C1X?
 
yes, I do not know much about it tho'
 
@CodeMonkey C99 + 1?
 
C1X is the unofficial name of the planned new standard for the C programming language. It is intended to replace the existing C standard, informally known as C99. This new version mainly standardizes features that are already supported by common contemporary compilers in an implementation-defined way. Due to the poor availability of conforming C99 implementations, C1X will include more optional features, to make it easier to comply with the core language standard. The new standard is not yet finalized. The most recent working draft, N1570, was published in April 2011. GCC version 4.6 adds ...
 
8:17 PM
> Type-generic expressions using the _Generic keyword.
WTF?
 
Yeah.
template wasn't available for some reason.
 
template-wannabe?
 
Not quite.
You need to actually write the different instances by hand.
 
So it's not really templates.
 
hence the wannabe!
 
8:21 PM
> The new revision will allow implementations not to support certain parts of the standard — including some that had been mandatory to support in the 1999 revision.[8] Programs can use predefined macros to determine whether an implementation supports a certain feature or not.
Sweet, that makes things so portable.
 
DIY portability
 
How can you DIY VLAs?
 
alloca!
 
lots and lots of macros?
 
@MartinhoFernandes They do like weird-looking keywords, don't they.
 
8:23 PM
@hexa With a bunch of macros.
They might have just standardized alloca instead.
 
Someone told me the other day of the usefulness of VLAs because of its pointers
but I failed to understand
 
Because VLAs are also a syntax feature.
@hexa "day".
 
rofl
brain fart
 
@CatPlusPlus There's also _Atomic, and _Thread_local.
Of course, all optional.
 
That _Generic doesn't look particularly generic. A switch on types.
@MartinhoFernandes And _Bool from C99.
 
8:28 PM
I like it though, It could be really useful and avoid stuff like f(void * p, int p_type) functions
it is some sort of type-checking
 
Fugly as hell, but it is something.
WTF is rsize_t?
errno_t strcat_s(char * restrict s1, rsize_t s1max, const char * restrict s2);
> This allows the size to be compared against the reasonable limit for a single object, RSIZE_MAX.
?
Ugh, more errno crap.
 
where is this from
can I unflag something? Like, I flagged wrongly so I want to remove my flag
it is not possible, right?
 
8:49 PM
hi cat plus plus
whats up friends
 
@CatPlusPlus: I got Detours working with MingW and GCC :-)
Ultimately it wasn't actually that hard - had to make some very minor modifications to detours.h, download a copy of dbghelp.h and define _MSC_VER.
Making DLLs with GCC is no problem. You just need to extern "C" __declspec(dllexport) your DllMain().
 
wow every one seems busy today
i am free because i am job less today
i am enjoying movie today
 
user457812
Yay, joblessness
 
what movie?
 
user457812
High-five!
 
8:57 PM
I have a question... does this counts as "too localized"?
0
Q: is reference counting good design

anirudha13We are working on an application container that uses reference counting as the mechanism to keep track of the requests received and responses sent. The reference count is used in allowing the graceful shutdown of the container, i.e. if (refCount == 0) shutdown; The reference count is incremented...

 
user457812
I don't really get the impression that it is
 
@tkerwin Law.Abiding,Citizen nice idea used by script writer
 
user457812
Why the odd punctuation in place of spaces? O_o
 
that got really bad reviews
 
user457812
Eh, a lot of fun movies get bad reviews
 
9:01 PM
that's true
 
@tkerwin i don't care its viewer choice i like concept
actually today is my movie day
and i have watched 4 movie hahaha
 
what else did you watch?
 
user457812
In retrospect, my choice of microwave burritos for lunch may have been a poor one
 
@nil A microwave oven ruins a lot of meals.
 
I think it's really the freezer that ruins the burrito.
 
user457812
9:05 PM
I prefer frying things, but I haven't gone shopping recently and the only food I have left is microwaveable stuff
 
Although the microwave is not always kind to food
 
user457812
So, I suffered the burrito on short notice
 
user457812
I need to buy some more tortillas so I can make my own burritos
 
@tkerwin limitless,rango,The.Ward,hidden
 
If your space is broken you can copy this one: -> <-
 
9:07 PM
I had a piada today, it's kind of like a burrito
 
@Cat ironically, when I copy that space, it doesn't paste.
This space doesn't > < this one doesn't either > <
 
why every one keep quiet
 
I believe that I'm currently watching one of the best moments in anime ever: the boxing match between Takamura an Hawk.
 
is any one belong with muslim country
if belongs then "ramzan mubark" i mean HAPPY RAMZAN
 
ked
uh... is this the right place to look for help for C++ programming?
 
9:18 PM
@ked Depends on what you mean by "help"
 
@ked this is the place where C++ programmers talk about non-C++ related topics
 
you should search in (and ask on) the Q&A part first, usually
but depends on the question, mostly
 
Although, sometimes it's C++ related.
 
Sometimes.
 
@ked protip: you should ask advice on singletons
 
ked
9:19 PM
haha okay, later all then i guess
 
@ked: also refer to C++ as: C/C++
 
@ked there is this great website to ask questions: www.stackoverflow.com
 
@ked do you really have quesion
 
ked
-.- yes yes i get it guys
 
but ask anyway!
 
ked
9:20 PM
@JitendraPathak yah
 
go ahead
 
ked
um... familiar with the .get() function?
 
of what class?
 
ked
ifstream
 
what about it?
 
9:22 PM
@MartinhoFernandes That's not being traditional, that's being a selfish failure of a father dickhead.
2
The kind that end up buried in the backyard.
 
ked
i know that the .get() function gets the first char in a document, how do you make it where it will move onto the next char instead?
... each time you call it?
 
Well, I don't understand what you mean
Sorry but the office is closing here and I have to leave before getting locked in
@CatPlusPlus can help you, ask him. he is the stream master
 
@ked get() gets the next character in the stream every time you call it.
 
ked
aww damn... that means me program is messed up -.-
 
If you want to skip a character, call get() and ignore what it returns.
 
ked
9:26 PM
thanks!
 
@ked ah, gah gah gah gah gah.
 
so ked is your problem solved
 
ked
well... it helped me narrow the issue down, i know its not the.get() funct thats messin up
but yah its just gettin stuck in this loop so i have to look around
 
I'M
too sexy for my shirt
 
ked
whatever it is, its also a memory leak
 
9:33 PM
you can paste for looping code here
 
ked
void mark()
{


char c;
c = doc.get();

if (c = '<')
{
while (c != '>')
{
str += c;
c = doc.get();
}

}


if (str == "<BlastOutput_query-ID>")
{
int loop = 0;
queryID.clear();

while (queryID[loop] != '<')
{
c = doc.get();
queryID += c;
loop++;
}
queryID[loop] = ' ';

str.clear();

addon[1].clear();
addon[1] = queryID;
}

if (str == "<BlastOutput_query-def>")
{
int loop = 0;
queryDEF.clear();

while (queryDEF[loop] != '<')
{
c = doc.get();
queryDEF += c;
loop++;
}
queryDEF[loop] = ' ';

str.clear();
 
@DeadMG i think your shirt is not washed
 
ked
13 Gb of ram taken up and still climbing :P lol
 
@hexa Whut.
 
ked
@CatPlusPlus he was telling me to ask for help but im all good now
ask help from you*
@JitendraPathak anything yet?
 
9:40 PM
nop
 
ked
damn
well, this is also in the loop...
if (line == 0)
{
out << "Query ID\tQuery Def\tQuery Length\tHit #\tHit ID\tHit Def\tHit Accession\tHit Length" << std::endl;
line++;
}
else
{
out << queryID << "\t";
out << queryDEF << "\t";
out << queryLEN << "\t";
out << hitNUM << "\t";
out << hitID << "\t";
out << hitDEF << "\t";
out << hitACC << "\t";
out << hitLEN << "\t";
out << std::endl;
line++;
}
but i dont think ther is any issues here
 
did you try putting in some debug statements?
 
ked
yep... it being an xml file wouldnt effect if would it?
by it i mean doc is an xml file
 
i mean in your code, print out str in some places
it's hard to tell where your problem is
 
ked
i am right now
oh yay found it! its getting stuck here
if (c = '<')
{
while (c != '>')
{
str += c;
c = doc.get();
}

}
 
9:46 PM
heh
if (c = '<')
maybe you want c == '<'?
 
ked
aww crap lol i do that all the time
still bugging out there, i even put a sleep in the loop and its just skippin it
 
you said this was xml?
 
ked
yah
 
you might want to consider using tinyxml or something similar
 
ked
too lazy sry
 
9:49 PM
Eh
 
ked
oh yes working now!
 
you're too lazy to get a program that will actually work?
 
Using a parser is much easier than doing it by hand
 
i write simple parsing code for flat files sometimes, but when you get to XML, it's time to use the libraries
 
I concur, you're best of parsing XML with a library, it's more complicated then you might imagine, trying to write one's own parser
 
ked
9:52 PM
im trying to make me own :P
 
if you're trying to do something simple like a config file, consider the ini file format
 
ked
its claiming its not coming across '<'
 
@ked Reinventing the wheel will lead you straight to programmer's hell.
 
ked
i trying to write my own program for this and i know there are easier ways, but im doing it this way so yah
 
Where maintenance is painful.
 
9:56 PM
@ked are you professional or student?
 
ked
professional student, and im dead serious
its job/class
 
ked
ah, thats the problem, its not reading the right file... i think, doc.get() is returning -1 the whole time
im trying to create a unique parser that reads specific files, the exsisting ones are terribly slow, and if mine worked, it woud go 20 times faster
 
@ BEST OF LUCK KED good night friends its late night in india
 
ked
thx!
 
10:07 PM
@CatPlusPlus: Is you here?
 
10:44 PM
No linker in CUDA is cramping my style.
 
@DeadMG Sort of.
 
it's ok, I don't need you anymore anyway :P
 
Harsh.
 
Hey guys
I just finished writing a little arduino program to open and shut my door :D
 
11:00 PM
that's pretty cool
 
Glad someone's here ;L
 
Haha
I think it will be pretty cool
But the whole Metro UI thing doesn't really appeal to me
On a desktop
I don't think it makes much sense
 
what, you mean the tablet-style thing?
 
Yeah
Made up of tiles
I know this probably isn't the right place to ask this
But what the is wrong with this:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /$1.php [L,QSA]
*what the hell
 
11:07 PM
how am I even supposed to know what language that's in?
you really need a full question
 
.htaccess
Oh i got it
It just doesn't do what I thought it would
Don't you just love lmgtfy.com :D
 
user402642
Does multiplying 0 by 0 more computationally intensive than say.... 100 * 100?
 
My gut answer would be no
But
If the 0 was stored in a byte
and 100 in a double
then I think it would be
 
no
the CPU doesn't need more time
 
11:24 PM
Oops I misread the wuestion
*question
Ignore the last bit
I got them mixed up :L
 
user402642
11:34 PM
@DeadMG so regardless of whatever two numbers are multiplied, assuming they are the same type, 0 * 0 is the same as 10000000* 100000000 ?
 

« first day (291 days earlier)      last day (4650 days later) »