![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2008
Posts: 19
Rep Power: 0
![]() |
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: c Syntax (Toggle Plain Text)
c Syntax (Toggle Plain Text)
using namespace std; c Syntax (Toggle Plain Text)
Thanks in advance Last edited by Ancient Dragon; May 5th, 2008 at 8:15 PM. Reason: add code tags |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 816
Rep Power: 4
![]() |
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.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2008
Posts: 19
Rep Power: 0
![]() |
Re: Setting up
Thank you very much Sir. I appreciate the help
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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++.
__________________
>BstrucT |
|
|
|
|
|
#5 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 816
Rep Power: 4
![]() |
Re: Setting up
Yes, you can use printf in c++.
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: Setting up
Why mix C and C++? That's just unprofessional, not to mention ugly.
|
|
|
|
|
|
#7 |
|
Hobbyist Programmer
|
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.
__________________
>BstrucT |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Batch] Setting up Visual Studio build script | Klarre | Other Scripting Languages | 4 | Mar 28th, 2008 8:03 PM |
| Setting up Apache | jman05 | Other Web Development Languages | 9 | Nov 10th, 2006 12:58 PM |
| need help setting up php and apache on my windows XP machine | dark_omen | PHP | 3 | Jul 10th, 2006 8:12 AM |
| Setting Process Name | HackeZ | C++ | 11 | Dec 26th, 2005 11:25 AM |
| Programmatically Setting Environment Variables | ChiHappens | C# | 1 | Sep 26th, 2005 2:51 PM |