Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 typedef
Index -> Programming, C++ -> C++ Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Geminias




PostPosted: Tue Dec 20, 2005 1:15 pm   Post subject: typedef

in the visual c++ ide there are predefined typedef's like UINT for unsigned int. The only library i include is <windows.h> and yet, when i try to compile the same code, using those typedefs in mingw's compiler it won't work. I include all the same header files.

So maybe visual c++ is more then just an ide? Or does it's compiler automatically recognize these typedefs? If so, can someone refer me to a list of all these alias's... i'd like to see a comprehensive list of them.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Tue Dec 20, 2005 2:02 pm   Post subject: (No subject)

By "doesn't work", can you showus the exact code you're using, the exact compiler command, and the exact error message(s)?
md




PostPosted: Tue Dec 20, 2005 2:07 pm   Post subject: Re: typedef

Geminias wrote:
in the visual c++ ide there are predefined typedef's like UINT for unsigned int. The only library i include is <windows.h> and yet, when i try to compile the same code, using those typedefs in mingw's compiler it won't work. I include all the same header files.

So maybe visual c++ is more then just an ide? Or does it's compiler automatically recognize these typedefs? If so, can someone refer me to a list of all these alias's... i'd like to see a comprehensive list of them.


UINT and it's related typedefs are not standard types. You'd be much better off just using unsigned ints. As for Visual C++, depending on what version you use it's libraries aren't standard.

If you are going to use MSVC++ use 7.0 or better (ei. MSVS 2003.NET includes MSVC++ 7); and be sure to use standard correct code. Again UINT and it's related typedefs are not standard types, you should avoid them as much as possible (which is to say don't use them).
Geminias




PostPosted: Tue Dec 20, 2005 7:23 pm   Post subject: (No subject)

by 'won't work' i mean that code which compiles fine in visual c++ 6.0, doesn't compile in mingw due to undeclared types. UINT must not be in the windows.h header, which means that its something the vc++ compiler has built in.. unless it automatically attaches the definitions of these typdefs.. but anyways.. the question is anyone have a comprehensive listing of all these new microsoft typedefs.

cornflakes it may not be standard but in order to read code written in VC++ it is necessary to have a 'dictionary' if you will. So yes, if anyone knows anything about such a listing it would be great.
Martin




PostPosted: Tue Dec 20, 2005 7:26 pm   Post subject: (No subject)

So why not just #typedef UINT unsigned int ?
wtd




PostPosted: Tue Dec 20, 2005 7:28 pm   Post subject: (No subject)

Geminias: your dictionary is MSDN.

And if you're strictly targetting Windows, why not use C#?
Geminias




PostPosted: Tue Dec 20, 2005 7:55 pm   Post subject: (No subject)

there's a bunch of them martin, i was using UINT as an example.. yeah msdn indeed, but its all sprawled out and disconnected, i was looking for a solid chart or something. The other thing is, i'd like to see a listing of all the functions included in windows.h

not using c# because i dont want to learn it yet and i dont know much about it.
wtd




PostPosted: Tue Dec 20, 2005 8:02 pm   Post subject: (No subject)

Geminias wrote:
its all sprawled out and disconnected


That's the nature of the internet. Use the search.

Geminias wrote:
not using c# because i dont want to learn it yet and i dont know much about it.


It's a lot easier to use than C++, and the libraries are better. No one starts out knowing much, but that's called learning.

Not Learning C# with your goals is like walking 20 miles everyday because you don't want to learn how to drive.

Good programmers are lazy, but they also work very hard at being lazy.
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Tue Dec 20, 2005 8:16 pm   Post subject: (No subject)

My buddy Holden summed up the CSer mindset perfectly.

"Work?! This'd take me an hour to do! BUT I can write a perl script in five minutes that'll take the computer two hours to do and none of my time. And I'll get paid twice as much for it."

But really, C# is really cool, and is probably more useful to learn than MS specific C++ right now. Makes things like DirectX a dream to do.
wtd




PostPosted: Tue Dec 20, 2005 8:26 pm   Post subject: (No subject)

Martin wrote:
My buddy Holden summed up the CSer mindset perfectly.

"Work?! This'd take me an hour to do! BUT I can write a perl script in five minutes that'll take the computer two hours to do and none of my time. And I'll get paid twice as much for it."


And then spend another five minutes turning it into a module so that subsequent scripts only takes three minutes to write. Smile
Martin




PostPosted: Tue Dec 20, 2005 9:31 pm   Post subject: (No subject)

wtd wrote:
Martin wrote:
My buddy Holden summed up the CSer mindset perfectly.

"Work?! This'd take me an hour to do! BUT I can write a perl script in five minutes that'll take the computer two hours to do and none of my time. And I'll get paid twice as much for it."


And then spend another five minutes turning it into a module so that subsequent scripts only takes three minutes to write. Smile


No no, that comes later. Turning it into a module while the program is running would cause reduced performance for the program and reduced sleep time for the programmer.
Geminias




PostPosted: Tue Dec 20, 2005 9:39 pm   Post subject: (No subject)

spammers. i try to make my question out so people know exactly what i'm asking.. i dont see the point in that if people just talk about whatever.

so i take it no one knows where to find a chart on the windows.h library and also a chart on the typedefs...

if you do please feel free to tell me Rolling Eyes
wtd




PostPosted: Tue Dec 20, 2005 9:41 pm   Post subject: (No subject)

That header file is enormous, and we've told you exactly where to find the best information on it.
md




PostPosted: Tue Dec 20, 2005 10:38 pm   Post subject: (No subject)

the windows.h header includes so many different headers (which include even more headers) that there is no way you're getting a listing. Remember that windows.h include almost the entire win32 API.

You're better off doing as wtd sugests and learning C#
wtd




PostPosted: Tue Dec 20, 2005 11:00 pm   Post subject: (No subject)

And no, that's not a "learn C# because you're an idiot and you can't handle C++" suggestion.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: