![]() |
Setting up
Fairly new to programming. Any advice would be appreciated.
Thanks in advance OK, I am using Microsoft Visual C++ for all of my C++ programming. We have done some very basic code just to get an overview of what is going on. I have found some code below, this code is pretty long compared to what we have done as we skimmed over the programs. But in MS Visual C++ how would I put this into the program. THREADS: :
:
using namespace std; :
Thanks in advance |
Re: Setting up
pthread.h is a posix (linux/unix) include file. It is not included in Visual C++. For threading under Visual C++, you would need to use something like the _beginthreadex function, which is in process.h. It might be easier to search for a different sample, rather than trying to convert this program to be compilable under Visual C++. There is a sample program here: http://simplesamples.info/Windows/_beginthreadex.php that I found using Google.
|
Re: Setting up
Thank you very much Sir. I appreciate the help
|
Re: Setting up
Just a little question guys...
Can the printf() function be used in C++ as well as in C? Or is only 'cout' allowed in C++? This is probably a dumb question but I know a lot of C syntax can be used in C++. |
Re: Setting up
Yes, you can use printf in c++.
|
Re: Setting up
Why mix C and C++? That's just unprofessional, not to mention ugly.
|
Re: Setting up
Thanks Alias, wasn't planning on mixing the two though, just wanted to know wether some of C syntax could be compatible with C++.
But thanks for the heads up man. I started out with C, then did some Visual C#, and am now just familiarizing myself a bit with C++ syntax as most seems to be more or less the same as C, but I guess that will all change once I reach the OOP section of the tutorials I am busy with. Oooh, and pointers. |
| All times are GMT -5. The time now is 3:50 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC