|
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
|
|
|
|
|
It sounds like you include directories/paths, and/or their order, may be messed up...
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
|
|
|
|
|
Looks like a VS 2005 Issue, cause if I use VS 6, there are no errors..
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Have included excpt.h somewhere in your program, which is not supposed to include in user program ?
[Edit] or stdexcpt.h [/Edit]
|
|
|
|
|
Hi,
Thanx for the response, I have included fstream.h
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Can you provide some code snippet, info( which IDE), to reproduce the error.
|
|
|
|
|
I'm using VS 2005 Professional VC++ (NOT CLI)And I'm including the fstream header to write to a file. As follows:
#include fstream.h And receive the following error:Error 1 fatal error C1189: #error : ERROR: Use of C runtime library internal header file.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: I'm using VS 2005 Professional VC++
I wonder , how statement #include <fstream.h> is compiling in your case, it should be #include <fstream> .
|
|
|
|
|
Sorry I left out the <> in the previous thread....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|