Re: typedef statement - easy one Programming Software Development by Sky Diploma … there is a huge difference between Macro's and Typedef's Macro's follow a " find and …quot; mechanism before the code is actually compiled. Typedef's almost do the same thing but instead of … again. Now lets consider the second statement. [code]typedef CtrlList::const_iterator const_iterator;[/code] Now we specify that [icode… typedef statement - easy one Programming Software Development by ermithun typedef std::list<LDAPCtrl> CtrlList; typedef CtrlList::const_iterator const_iterator; please help me in understanding the above typedef statements as we know that typedef syntax is, typedef <attributes> datatype aliasname Thanks. Re: typedef statement - easy one Programming Software Development by kvprajapati typedef specify a synonym for a type. You can use typedef declarations to construct shorter or more meaningful names for types already defined by the language or for types that you have defined. Read [URL="http://msdn.microsoft.com/en-us/library/05w82thz(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/05w82thz(VS.71).aspx[/URL] Typedef struct? Programming Software Development by maybnxtseasn typedef struct _FOO { int blah; int blah2; int blah3 } FOO, *FOO; … a pointer to a FOO? 2.) OR does it just typedef the names so you don't have to do the… typedef Programming Software Development by jimJohnson I have a homework problem that I am being asked the following.... Write typedef statements that make both Real and SinglePrecision synonyms for float I just want to verify this is correct typedef float Real; typedef float Singleprecision; typedef Programming Software Development by midwesternstyle … type def in a header file and using the same typedef in a source file (.c). Any help would be appreciated… a keypad( i would like to use numerics as my typedef). the numerics only returns a float number. my code float… Re: typedef Programming Software Development by dwks … require some extra work to do that. What is the typedef supposed to do? You need to provide more information. Re: Typedef Programming Software Development by Narue …] The enum keyword is only part of a type, while typedef may accept this line, you can't subsequently use [B… Typedef Programming Software Development by Daita …<stdio.h> #include<conio.h> main() { typedef enum y; int c; y colour {RED,WHITE,BLUE,BLACK… Re: Typedef struct? Programming Software Development by abhimanipal Run this program. This should clear your confusion [CODE] #include<stdlib.h> typedef struct Person { char fname[100]; }FOO,*FOO1; int main() { FOO f1; FOO1 f2; printf("%d %d\n",sizeof(f1),sizeof(f2)); return 0; }[/CODE] Typedef vs. Non-typedef function pointers. Programming Software Development by triumphost … DATA ptr_wglUseFontOutlinesA @942 DATA ptr_wglUseFontOutlinesW @943 DATA But with the typedef, that "DATA" part is gone. Any ideas … why this behaviour without it :S? **Sample code with the typedef:** typedef void (__stdcall *ptr_glAccum) (GLenum op, GLfloat value); ptr_glAccum optr_glAccum; optr_glAccum… Typedef for a template? Programming Software Development by Fbody …lt;'[/QUOTE] 2.)[CODE]template <typename T> typedef CategoricalStats<T> QualitativeStats<T>; template &…lt;typename T> typedef NumericalStats<T> QuantitativeStats<T>;[/CODE…]Error(s):[QUOTE]a typedef template is illegal syntax error : missing ';' before '<… Re: Typedef for a template? Programming Software Development by kes166 …[URL="http://stackoverflow.com/questions/1474417/typedef-a-template-class-without-specifying-the-template-…similar problem[/URL] where someone suggested wrapping the typedef in a structure. [code] template <…typename T> struct QuantitaveStats { typedef NumericalStats<T> type; } [/code] Then invoked… Re: Typedef for a template? Programming Software Development by Fbody I have tried this as well:[CODE]typedef CategoricalStats QualitativeStats; typedef NumericalStats QuantitativeStats;[/CODE]it produces:[quote]'Statistics::CategoricalStats' : use of class template requires template argument list see declaration of 'Statistics::CategoricalStats'[/quote]I just realized I didn't mention it. Re: Typedef for a template? Programming Software Development by mrnutty …> class CategoricalStats { ... } template<typename T> struct QualitativeStats{ typedef CategoricalStats<T> Type; } //... QualitativeStats<float>::Type… Re: typedef struct etc... Programming Software Development by Dave Sinkula … function. Since what you're looking at is a typedef for a function pointer, the part about it being …. [QUOTE=suncica2222;1123088]is BOOL bool type or typedef for int? [CODE]typedef BOOL [/CODE][/QUOTE] Since it seems to be… the skirt kinda defeats part of the purpose of a typedef anyway. [QUOTE=suncica2222;1123088]why is this in () ??? … typedef or a multidimensional array? Programming Software Development by acchao … for 512, 63 for 4096 #define MAXWORDSPERFRAME 16 typedef int compressed_frame[MAXWORDSPERFRAME]; typedef struct { mSEED_header head; compressed_frame frames[MAXSEEDFRAMES]; } …sizeof(int)*MAXWORDSPERFRAME)); }[/CODE] Right now I'm using typedef and to copy over the [INLINECODE]mSEED_data.subframe[/INLINECODE] … typedef 3D array of map containing a set in undefined dimensions Programming Software Development by whitebloodcell …dimensions in the declaration below). I want to do a typedef not just for these specified dimensions, but in general so…string,set<MatchRecordPointer>> PlayerHistoryMap; typedef array<PlayerHistoryMap,5> ArrayOfPlayerHistoryMap; typedef array<ArrayOfPlayerHistoryMap,4> Array2DPlayerHistoryMap; Array2DPlayerHistoryMap… Re: typedef or a multidimensional array? Programming Software Development by Salem …]sizeof(compressed_frame)[/INLINECODE] to maximise the benefit of using the typedef. > [INLINECODE]int subframe[MAXWORDSPERFRAME];[/INLINECODE] Saying [INLINECODE]compressed_frame subframe…. Though if you made it a struct, like this [code] typedef struct { int frame[MAXWORDSPERFRAME]; } compressed_frame; [/code] Then you would be… Re: typedef struct etc... Programming Software Development by suncica2222 … we have both types and variable names ??? LPCTSTR lpApplicationName [CODE] typedef BOOL (WINAPI *_CreateProcess)( //BOOL je int??? LPCTSTR lpApplicationName, LPTSTR …again int is returning type for all functions under this typedef? [CODE]typedef int (TMyClass::*pt2Member)(float, char, char); [/CODE] Re: Typedef for container Programming Software Development by rubberman …::vector<Student_info> container_Student_info;` should be this: `typedef std::vector<struct Student_info> container_Student_info;` Of course,… you could do this: typedef struct Student_Info studentinfo_t; typedef std::vector<studentinfo_t> Student_info_containter_t; I like … Re: typedef usage doubt Programming Software Development by sepp2k …can be stored in arrays. The syntax of a `typedef` is basically the same as that of a variable …definition (except for the keyword `typedef` in front obviously). The name of the typedef goes where the variable name would…stores a character array of size 80, `typedef char Text[80];` defines a typedef named `Text` that describes character arrays … Re: typedef 3D array of map containing a set in undefined dimensions Programming Software Development by mike_2000_17 …This would make your lines look like this: typedef map<string,set<MatchRecordPointer>> PlayerHistoryMap…; typedef vector<PlayerHistoryMap> ArrayOfPlayerHistoryMap; typedef vector<ArrayOfPlayerHistoryMap> Array2DPlayerHistoryMap; Array2DPlayerHistoryMap … Re: typedef or a multidimensional array? Programming Software Development by Salem > Would I use compressed_frame subframe; as I would use an array of int's? Yes. Remember that typedef doesn't add anything new, it just allows you to express something in a more compact or readable form. So if your typedef is an array, then all the usage will reflect that. typedef struct etc... Programming Software Development by suncica2222 …I see this inside () is struct and BOOL is typedef for int actually ???? ,but what is (WINAPI *…_CreateProcess) ????? its loks like typedef <type><type><list of …types> ????? Can some one explain this? [CODE]typedef BOOL (WINAPI *_CreateProcess)( //BOOL is int??? LPCTSTR lpApplicationName… Typedef for container Programming Software Development by Tinnin … as follows; #ifndef GUARD_Container_h #define GUARD_Container_h #include <vector> typedef std::vector<struct> container_Student_info; // Two errors here #endif… I am getting the following errors on the typedef line (6); error: template argument 1 is invalid error: template… Re: typedef or a multidimensional array? Programming Software Development by acchao Just to clarify.. [INLINECODE]typedef int compressed_frame[MAXWORDSPERFRAME][/INLINECODE] Would I use [INLINECODE]compressed_frame subframe;[/INLINECODE] as I would use an array of int's? [INLINECODE]subframe[pos] = data;[/INLINECODE] Thanks Again! Re: Typedef'd return-value outside of a template doesn't work Programming Software Development by ArkM …lt;typename T> class Sample { private: typedef std::vector<T> vectorType; vectorType vector; …public: typedef typename vectorType::iterator vectorIterator; vectorIterator begin(); }; …][code] template<class T> struct A { typedef int B; A::B b; // ill-formed: typename… Re: typedef struct etc... Programming Software Development by suncica2222 … lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation );[/CODE] is BOOL bool type or typedef for int? [CODE]typedef BOOL [/CODE] why is this in () ??? is this… Re: Typedef for container Programming Software Development by NathanOliver Well if you struct is called Student_info then you would use typedef std::vector<Student_info> container_Student_info; The syntax for this is typedef std::vector<type_of_object_you_want_for_the_vector> name