>> Although, I guess it would be just as easy to use the horizontal scroll bar to move over if it's indented a lot... Maybe that would ........ off the vi people enough to switch to a real IDE.
Yeah, I use a Scintilla-based IDE and it definitely has issues with horizontal scrolling (read: convulses). What do you use, by the way?
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Oh great -- now we're talking about editors!
Usually KDevelop. Sometimes kate. Occasionally vim.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
>> would give you 3 pointers, it IS part of the name
Tomorrow your going to wake up and realize that that doesn't make any sense.
EDIT:
>> would give you 3 pointers
Actually, that probably would have been a good way to implement it, from a language-design standpoint.
Last edited by Sebastiani; 06-16-2009 at 03:48 PM.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
>> Sure it does. The only ptr will be the first one. What if you wanted 2, are you supposed to go
Well, OK. It kind of "straddles the fence" then, I guess. But I still wouldn't consider it part of the name.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Technically speaking, it's part of the declarator. A declgroup is formed of a single declspec, followed by one or more declarator-initializer groups. Everything that binds to the name (pointer, reference, array bounds, function arguments) is part of the declarator, while the bunch of keywords (typedef, friend, const, volatile, auto, static, extern, int, long, short, unsigned, signed, wchar_t, char, bool, float, double, class, struct, union) at the start is the declspec. The declspec combines with each of the declarator-initializer groups to form declarations.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
>> Technically speaking, it's part of the declarator.
Well that settles then, I guess.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Being a pointer is part of the type. The * is part of the declarator that makes the declared entity be of pointer type. Or in other words, from a compiler writer's view, types are a property of variables and expressions, not of declarations.
In yet other words, compiler writers have a slightly different naming convention for code. In this:
most programmers would call "int *" the type. But to me, the only type here is "pointer to int", which is a property of the variable p. "int *" is just a part of the declaration of p.Code:int * p;
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
The way I was taught to look at it is this:
Kind of like you're declaring the dereferenced foo and bar as ints, from which implicitly follows that they're both of type pointer to int. Before someone explained it to me like this I was switching between the three styles as I couldn't decide which one made the most logical sense to me.Code:int *foo, *bar; *foo is an int *bar is an int