Click to See Complete Forum and Search --> : Data types
jom20
August 22nd, 2003, 06:32 AM
Hi,
Its a really stupid question however, can anyone explain this line of code to me please
#define S_IDLE ((uint16) 0)
I know its defining a constant call S_IDLE, and I know its an unsigned short.
In java when its written like that I think it means casting it to a unsigned short, but I am not sure if this is the same for C++.
and also this line
typedef struct
Thanks
Trisha
Andreas Masur
August 22nd, 2003, 06:42 AM
Originally posted by jom20
In java when its written like that I think it means casting it to a unsigned short, but I am not sure if this is the same for C++.
Yes...this is an old-style C cast...
Originally posted by jom20
and also this line
typedef struct
Well...what is your question with that line? I mean the line is basically incomplete... :cool:
jom20
August 22nd, 2003, 08:53 AM
The block code is:
typedef struct
{
uint16 uiCom;
boolean block;
}TxAdmin
I dont understand what this means.
jom20
August 22nd, 2003, 08:56 AM
In visual C++ I need to include some header file from the software for my chip. I know the directory where they are stored the problem is that when I type for example #include "app.h" I get an error saying that it cannot find the directory. How can I overcome this. DO I need to copy and paste the codes from these header files into one that I create myself.
Or do I need to move the directory.
Thanks
HeartBreakKid
August 22nd, 2003, 09:17 AM
You need to specify the include directory for your project:
1. Open your project in Solution Explorer (from VS.NET, View->Solution Explorer)
2. Right click on your project name, and go to properties.
3. On the left hand side (the tree view) select Configuration Properties->C/C++->General.
4. The first line in the list view, should say "Additional Include Directories", and any additional directories that contain include files there. You can specify the full path (C:/myproject/blah/blah/includes), or a relative path (../../../blah/includes).
jom20
August 22nd, 2003, 10:22 AM
Thanks HeartBreakKid, I tried it and it worked.
Andreas Masur
August 22nd, 2003, 10:35 AM
Originally posted by jom20
The block code is:
typedef struct
{
uint16 uiCom;
boolean block;
}TxAdmin
I dont understand what this means.
This defines a new datatype named 'TxAdmin' which is a structure. This is the old ANSI C way of defining structure types. In C++ however, this is not necessary any longer since 'struct' will already define a new type. Nevertheless, the above will also work with any C++ compiler...
jom20
August 22nd, 2003, 11:11 AM
Thanks Andreas.
I was a bit lost on that one. Do you know of any sites apart from msdn.microsoft.com that explains the language structure.
Thanks
Trisha
Andreas Masur
August 22nd, 2003, 05:52 PM
Originally posted by jom20
Do you know of any sites apart from msdn.microsoft.com that explains the language structure.
Well...to be honest...not really. I could name books rather than websites. However, using any search engine like e.g. Google should return many sites... :cool:
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.