Im new and iv got some questions...

Started by
7 comments, last by Kais0n 19 years, 9 months ago
Hello ppl, im 23, im from Germany i study Molecular Life Sicencies and iv got a problem... Im really new to programming, well actually i dont know much right now. After 2 Weeks of experimentig and reading these boards and some tutorials im quite fammilliar wit DEV C++. And here iv got some Questions... 1. What is the difference between iostream and stdlib.h ? Why are ppl using printf instead of cout? 2.What are all these libs? Are they good what are they for... (I know this might be a real DUMB Question but i cant figure it out) 3.Is it possible to write a GUI without Win32.API? What do i need to write a GUI. 4.Is it just me or is there actually a BIG gap betwwen beginner Tutorials and anything else? I understand all these Tutorials but as soon it is about something else if feel REALLY stupid... Please Help! I want to get all these Boardgames me and my freinds made troughout the last years get running on PC. Greetz Kais0n ;)
Advertisement
Quote:Original post by Kais0n
1. What is the difference between iostream and stdlib.h ?
Why are ppl using printf instead of cout?

stdlib.h is a C library, while iosteam is a C++ library. printf is obsolete and shouldn't be used unless you're maintaining an old project. They didn't take it out of the library because they can't afford to break millions of lines of code that already use it. As to people using printf in new projects, well, it's just an old habbit. You can use whichever you like the most but the C++ standards committee recommends using iostream.
Quote:Original post by Kais0n
2.What are all these libs? Are they good what are they for...
(I know this might be a real DUMB Question but i cant figure it out)

These are standard libraries that are provided along with the language to make the programmer's job easier. Some are useful, some are less so. For instance, instead of writing your own square root function, you can use the one from standard library. As time passes and you learn more, you'll find yourself taking advantage of more and more facilities provided by the standard libraries.
Quote:Original post by Kais0n
3.Is it possible to write a GUI without Win32.API?
What do i need to write a GUI.

Yes. There are plenty of libraries that "wrap" Win32 API. They provide a much nicer interface for you to program while hiding all the dirty Win32 API details. MFC is one such library, WTL is another. However, if you're a beginner and you need to quickly develop a GUI application, I suggest looking into VB or WinForms.NET.
Quote:Original post by Kais0n
4.Is it just me or is there actually a BIG gap betwwen beginner Tutorials and anything else?
I understand all these Tutorials but as soon it is about something else if feel REALLY stupid...

Well... It's usually easy to understand simple, insulated tutorials. It is much harder to put all the knowledge together and write a large software system. You can't expect to get good in a week. It takes about a year to become ok, three years to become proficient and five years+ to become an expert.
1) Iostream uses streams. You can use it only in C++, not C. Printf is an older function, and it works faster.
2) These libs contain functions. You can't make a program without them. Well.. you can, but you must write them yourself.
Quote:Original post by Kais0n
1. What is the difference between iostream and stdlib.h ?


Those are both header files. A header file is a file that you "include" into other files. The reason you do this? Header files have definitions of functions, structures, defines, etc., and if you want to use them, you need them defined. The implementation is often in a static or dynamic library file, or in a .c, .cpp, .C, .CXX file.

The difference between the two header files you've listed? iostream is a new c++ object file header (notice you don't need a .h) and stdlib.h is an old c style .h file. Please note that an object header file exists for stdlib (it's called cstdlib, and you don't need the .h). Anyways, other differences. Iostream defines IO routines, types, structures, classes, etc., and stdlib defines common functions, types, values, etc. that have no other library that they really fit in (like searching, sorting, random number generators, etc.).

Quote:Why are ppl using printf instead of cout?


printf is the old c style way to output text to the screen, wheras cout is the c++ method. cout is designed in an object oriented manner (inherits from ios class). Printf on the other hand is structurally designed. You can use either, depending on your own personal preference. If you want to use cout include iostream, if you want to use printf, include stdio.h.

Quote:2.What are all these libs? Are they good what are they for...
(I know this might be a real DUMB Question but i cant figure it out)


A lib is a library, mosttimes referring to a precompiled file with functions, macros, structures, functions and such inside of it that is described by a header file that you put in your files when you want to use said library.

Quote:3.Is it possible to write a GUI without Win32.API?
What do i need to write a GUI.


Of course it is possible. Win32 is just an API. There are other APIs you could use. QT, GTK, wxWindows, MFC (wrapper for win32), ATL, WTL, windows.forms (.NET languages, of which c++ is included), etc. There are alot of different libraries you can use to make GUI applications. If you want to step into slowly, I recommend trying tcl/tk using the c extensions.

Quote:4.Is it just me or is there actually a BIG gap betwwen beginner Tutorials and anything else?
I understand all these Tutorials but as soon it is about something else if feel REALLY stupid...


I think everybody starts that way. Once you have a very solid understanding of the basics though, the harder tutorials will seem much simpler. If you don't have a firm understanding, just taking the next step can seem all but impossible.

Quote:Please Help! I want to get all these Boardgames me and my freinds made troughout the last years get running on PC.
Greetz Kais0n ;)


Just don't rush it. It takes awhile to become a decent programmer. You need to set aside some time to learn the language you will be using thouroughly before you start worrying about windowing and graphical apis. Leave that stuff for like 3 months to a year from now (differs for everyone) and get yourself familiar with the basics enough that you don't have to refer to a book for every step you make.
if you are only interested in making board games then I would strongly suggest visual basic.

VB is very easy to pick up and you won't have any trouble making board games with an easy-to-create UI scheme. Also, you wont have to deal with all of the "under the hood" stuff that c/c++ will give you.

3 months - 1 year becomes 1 week to 1 month.
Wooha!
Guys u are fast...
@ CoffeMug
Thx for the very detailed answer. I know i cant expect to know everything in one week. But i can try be as good as one can be after one week ;)

Do u have any ideas where i can get some Intermediate Tutorials?

Damn ur are alle even faster than i can write!
Well i thought about using VB but i need C++ for my Classes at university.
Hello,
I'm 23, im from Germany too.

I can recommend a German tutorial.
But the forums are temporarily down.
It uses SDL.

Spieleentwickler-Board

I based an English tutorial on it. I'm not good at writing tutorials though.
Breaktris
Don't avoid it just because you decide not to use SDL.
If you understand what the code does you can create a simple engine,
using the tutorial and the documentation of a different API.
I looked up new C++ functions there:
http://cplusplus.com/
That is how I learned the C++ basics.

But again I really recommend the currently not available tutorial.
Btw ... both tutorials are not complete.
But hopefully you will get how it works and be able to finish your projects ...
Writing errors since 10/25/2003 2:25:56 AM
Thx Clueless ill take a look!

This topic is closed to new replies.

Advertisement