|
Yes you can you need to stc1 here is articles about it
|
|
|
|
|
Clickety[^]
-- modified at 23:40 Friday 9th February, 2007
Dario: How is "directory" in French? (I mean a file system directory).
John Simmons: "zee file holdaire thingie"
|
|
|
|
|
Which helps the OP how?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ah you are right, I was sure he once wrote an article on it. Looking at the title, I just snatched(mistakenly) it. Oops, wait a min, I'll update the clickety.
Dario: How is "directory" in French? (I mean a file system directory).
John Simmons: "zee file holdaire thingie"
|
|
|
|
|
I have the following code :
class Test
{
public:
static const foo = 1;
static const bar = 2;
};
int _tmain(int argc, _TCHAR* argv[])
{
cout << Test::foo << endl << Test::bar << endl;
return 0;
}
- and absolutely no idea why it is working. I left the type declaration by accident and realized later that it shouldn't work - at least in my book. But it does. Can anyone explain that to me ? Is there some kind of default data-type for such situations ? If so, what is it ?
wbr Brainley
|
|
|
|
|
If you mean why does this get treated like a const int, that is because that is exactly what you created when you typed const foo .
I believe that int is treated as the default type in a scenaro like this, which is why you sometimes see code like unsigned uiABC = 0 to create an unsigned int variable.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I wonder if it would be treated as a QWORD on a 64-bit machine
|
|
|
|
|
Not if they keep the width of the int type at 32-bits... But I do not have a 64-bit environment handy...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
WalderMort wrote: I wonder if it would be treated as a QWORD on a 64-bit machin
Probably.
int data type is environment specific which means that it's 16 bits wide in a compiler for 16-bit systems, e.g. the C-compiler for MicroChip PIC 18[^].
This is the standard, but a complier might not follow the standard.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
but the AMD 64-bit[^] docs specify that an int remains 32-bits in size. So I guess it really depends on how the compiler decides to interpret the code.
|
|
|
|
|
WalderMort wrote: but the AMD 64-bit[^] docs specify that an int remains 32-bits in size. So I guess it really depends on how the compiler decides to interpret the code.
Yep, very true.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Is that MS-Specific or ISO ?
wbr Brainley
|
|
|
|
|
I think that is standard, or at least assumed. I have seen bits of older code, on older VAXen or U*ix boxes, that has things like:
static SomeVariable = 1;
unsigned SomeOtherValue = 0; Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Mr.Brainley wrote: and realized later that it shouldn't work
Why shouldn't it work?
It's static, meaning all instances share the same varialble, and it's const meaning it will never change. So it's perfectly safe to declare it as you have done.
|
|
|
|
|
WalderMort wrote: Why shouldn't it work?
No data type.
|
|
|
|
|
Yeah, in versions of VS prior to V2005, it will automatically assume you meant static const int foo = 1;
In VS2005, it'll give a sensible error (We found exactly this in some of our code when upgrading projects to 2005)
|
|
|
|
|
As others have said, the compiler assumes you mean int if you don't specify a type. This was a holdover from C and is illegal in newer versions of the C++ spec.
|
|
|
|
|
i must robot arm simulation with opengl or another program.real robot arm ll return and simulation show it in the same time.if anyone can help me so i ll be very pleasure.i dont know anything about opengl.it s my greduation work.
|
|
|
|
|
Well, first try to take some time by writing a message that can be understood. Ask also precises questions. "I must do a program that simulate a robot arm with OpenGL, please help me" is not really a precise question.
And finally, yesterday I sent you a link to a complete course on OpenGL (and it is really well done). So, what is the problem with it ? Maybe you expect that we write your program for you ?
|
|
|
|
|
sorry but i m realy in hard nowadays.i have being attended electric-electronic engineering.now i wish my last year at university.i dont know anything about opengl.opengl is just part of my greduation work.i must control real robot arm and in additional i ll simulate real time simulation this arm.you told me that u sent me complete course on opengl.i didnt get it.if would u like to be guide of me about opengl so i ll be very pleasure cause i really dont know anything about opengl.thanks for your kindness.
|
|
|
|
|
Hi all,
What can I do about the following error:
Error 1 fatal error C1189: #error : ERROR: Use of C runtime library internal header file.
Thank you very much.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
It looks like you #include d a file that is used for building the RTL, where you should stick to the external interfaces presented by header files like stdlib.h , stdio.h , etc.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi,
Thanx for the response, I have included fstream.h, would this cause a problem? Previous versions of the program compiled, I have no idea why it is giving me crap now....
Thanx again.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
I do not think that would cause it, because that is a standard header file. Is that the file the error is being emitted from?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Makes sense .... Yes the error is being emitted from thr iostream header file which is used by the fstream header file.
#ifndef _CRTBLD
#error ERROR: Use of C runtime library internal header file.
#endif /* _CRTBLD */
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|