Search:
Type: Posts; User: kedaman
Search:
Search took 2.11 seconds.
-
How can i read files using 64 bit file pointer in linux?
Thanks.
-
Well the example shows how to do that, but thats not the point. I guessed he was asking for how to convert a string of digits to an integer.
-
http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html
-
Hmm.. I installed kdmtheme using adept manager but it does not show up in system settings. Isn't there any way to change the colour of the text more directly?
-
I didn't like gnome compared to KDE, but there is only this one thing that irritates me. I temporarly made the background white on my panels as grey on white is a slight (but far from satisfactory)...
-
The minimized windows have a greyish colour that is hard to read against the grey background on the taskbar, can't I change it somehow? :(
-
never mind sscanf, use strtod:
http://www.cplusplus.com/reference/clibrary/cstdlib/strtod.html
char str [5]="5.43",*endp;
strtod (str,&endp);
if(!*endp) cout << "str is a number"<<endl;
-
sscanf will tell you if the string you pass to it is a number.
char str [5]="5.43";
if(sscanf (str,"%*f")) cout << "str is a number";
-
My suggestion would be to do a stack based calculator. A stack based calculator, is even less restrictive, since it can do things like (2+3)*(3+4) where you have to store more than one result of...
-
http://www.cplusplus.com/reference/clibrary/cstdio/sscanf.html
-
You are asking the wrong questions. If you are looking for particular examples in which a template could be useful, you are trying to clean your teeth with a hammer. To understand the real power...
-
Today i wrote this code:
int nCr=1,i=0;
while(i!=r)
nCr=nCr*(n-i+1)/i++;
an algorithm that was presented here, that will be able to deal with larger integers without being inefficient:...
-
It should give you 42 yes, in base 13 :D
A note about recursion vs iteration: it is very unfortunate that this is the case but recursion is generally less efficient, but merely in the sense that...
-
It makes your life easier ;)
actually it is an attempt to answer one of those mystery questions:
http://www.google.com/search?hl=en&safe=off&client=opera&rls=en&hs=wE8&q=six+times+nine&btnG=Search
-
Also this is not a good idea:
Factorial(n) / Factorial(n - r)
For instance, if you have n=10 and r=2, you only need to calculate 10*9, but what the above will do is to calculate...
-
http://www.cplusplus.com/reference/clibrary/cstdio/fscanf.html
-
-
just replace C with whatever point you want the polygon to shrink toward.
-
EnumWindows will allow you to loop through all top level windows using a callback function. EnumThreadWindows will loop through all top level windows of a thread and Thread32First and Thread32Next...
-
Nice to see someone else who hates OOP and thinks it smells :D
OOP bundles together data and functions - this is highly undesirable and annoying. The concept used in for instance Haskell classes...
-
Hmm.. garbage collection... are they going to turn C++ into java? Concepts looks really nice - especially concept based overloading. This way you can do various things on different sets of types...
-
Certain amount of distance? Do you mean the perimeter of the polygon should be reduced a certain distance by shrinking the polygon? If so then it should shrink proportional to the ratio between the...
-
Those errors look like msvc errors to me, and msvc uses double underscore for inline asm as chemicalNova said i.e. __asm
For hexa decimals use 0x as a prefix for those number.
-
Both functions do the same thing, but in the latter, the this pointer of the instance x is passed in the call:
T x;
x.add(a,b);
in fact the latter could be described as doing this:
T.add(x,a,b);...
-
The reason why C++ will die soon is concisely stated in my signature.
-
struct c{
template <class X> int foo(){return 0;}
template <> int foo<int>(){return 1;}
};
gives
test.cpp:11: error: explicit specialization in non-namespace scope ‘struct c’
test.cpp:11:...
-
I forgot I got my live cd with me, it appears I have 4.1
-
I don´t have access to my machine at the moment but I don´t think the version is particularly old. It came with the latest ubuntu distribution i downloaded a couple of months ago. You are not really...
-
Also... is it at all possible to make template specializations for member functions in template classes? I don't seem to be able to do either partial or explicit specializations in gcc.
-
I tried it out in ubuntu, but scrolling or resizing windows is annoying slow :(
-
Long time no see woss :D
I'm only compiling with -fpermissive, but thats only because I haven't figured out how to fix this strange error yet:
rms.cpp: In member function ‘void...
-
Well that is certainly interesting. Maybe its just gcc that is at fault. I'd be happy to know if DevCPP is capable of it. Thanks.
BTW, if you remove the T paramteres, will it compile?
-
The reason why the brain is not a computer is because we didn't design it. Computers are a class of artificial objects, their purpose being computation; humans are not artificial objects.
-
Here's a workaround that seems to work :D
template <class H>
struct c{
template <class X,class Q,class T=void> struct h2{
static const bool val=false;
};
template <class Q, class T>...
-
Its only partial because gcc doesn't seem to like it otherwise nor does it seem to be allowed in the ISO standard, although I have a vague memory it used to work in MSVC..
Anyway, this gives me 0...
-
It doesn't actually concatenate, that's not the right word, concatenation is what ++ does. Lists (and thus also strings) in haskell are like stacks and p:q means p is the topmost element and q is the...
-
Ok so there was a way to sneak around that too, but I guess thats only because the example is so simple. But if we have something very complicated there instead of eos, perhaps even have c* then I'm...
-
Yeah that makes sense, as a factor in fact is a term and so it tries to match as much as possible while in factor, it gets the whole 3*5 with it.
In the first example, can't you put some sort of...
-
it could be rewritten as
"abb|ab"
but that last b could be involved in a more complex expression which would make it hard if not impossible to extract it and likewise (ab|a) could be a very complex...
-
Well, apparantley thats something you would need to do to parse say an integer, but is it really that resource consuming? Thanks for the suggestion though although I figured I would have to do...
|
Click Here to Expand Forum to Full Width
|