15,300 Posted Topics

Member Avatar for Talguy

You will have to implement some sort of thread synchronization scheme in order for the threads to access a single commen queue to prevent corruption of the queue data. That means only one thread can access the shared common queue at a time -- all other threads that want to …

Member Avatar for Talguy
0
684
Member Avatar for eggberto

most likely the problem is line 66. The value of variable [b]a[/b] may exceed the number of rows in the array [b]script[/b]. Count the rows in that array -- there are only 5. But the value of [b]a[/b] can be as much as 9. Most likely the same problem with …

Member Avatar for Salem
0
270
Member Avatar for chathuD
Member Avatar for Salem
0
152
Member Avatar for caut_baia

The way to communicate through com1 will depend on the operating system. MS-Windows, use CreateFile() to open the com port, then ReadFile() and WriteFile() to read/write to it. [URL="http://msdn.microsoft.com/en-us/library/aa363194(VS.85).aspx"]See commuications functions [/URL]for more details. I don't know a thing about ladder logic because I never programmed a PLC.

Member Avatar for Ancient Dragon
0
123
Member Avatar for JPGleason

Since you have to switch compilers anyway why not switch to one that is completely free for you to use as long as you want to use it? Code::Blocks with MinGW compiler and VC++ 2010 Express come to mind -- there are others too. Of course you may have to …

Member Avatar for Ancient Dragon
0
209
Member Avatar for empror9

First problem: what is your program going to do if I enter 50 characters? You should try that. Second problem: The for loop on line 8 is incorrect. [icode]for(int i = num1; i <= num2; i++)[/icode]

Member Avatar for siddhant3s
0
163
Member Avatar for skypower

I use Windows 7 and Code::Blocks works ok on my system. Uninstall CodeBlocks, use Windows Explorer to delete the install directory so that there are no traces of it on your computer, then download it again and reinstall it.

Member Avatar for skypower
0
146
Member Avatar for sgk26p10p07

Protected mode does not have access to real mode addresses. You have to switch back to real mode to access it. Yes its a pain in the butt. How to do it? I don't know, all I know is what I've read from documentation of dos extenders such as [URL="http://en.wikipedia.org/wiki/Phar_Lap_(company)"]Phar …

Member Avatar for Rider99
0
272
Member Avatar for gaurav2729

First you have to find out where tv.lib is located on your computer then tell your compiler. How to do that will depend on the compiler you are using.

Member Avatar for chirag64
-1
129
Member Avatar for Froger93

re-install windows 7 and let it take over the entire hard drive. Or you could try one of [URL="http://lmgtfy.com/?q=how+to+remove+dual+boots"]these methods[/URL]

Member Avatar for chrisbeechris
0
125
Member Avatar for chubbs1900

>>'A Plus!' [b]grade[/b] can only hold a single character, and that is not a single character but a string. If that is what you want then change [b]grade[/b] to a string. Note the use of the double quote instead of single quotes. [code] char studentScore (int score) { int temp …

Member Avatar for Computer Love
0
1K
Member Avatar for moroccanplaya

The instructions say that there must be three parameters to the function, not two. The third parameter is passed by reference. [code] int main() { int num1, num2, result; num1 = 1; num2 = 2; diff(num1, num2, &result); } [/code] The diff() function should do nothing more than calculate the …

Member Avatar for Nick Evan
0
133
Member Avatar for johndoe444
Member Avatar for sourabhtripathi
0
338
Member Avatar for ziyakhan10

line 22: drop the gets() because its very buggy. In c++ programs you should be using cin.getline() >>Then you should do the reading with the >> ifstream operator instead of .read and the << ofstream operator instead of .write The file is a binary file, not a text file. So …

Member Avatar for ziyakhan10
0
193
Member Avatar for Ancient Dragon

I have 64-bit Vista Home Premium with IE7 (also 64-bit). Unable to download and install flash player with that version of IE. I also have 32-bit Firefox and flash player works normally as expected with it. When I view Program and Features, I see Adobe Flash Player ActiveX and Adobe …

Member Avatar for pookie61
-5
1K
Member Avatar for vbx_wx
Member Avatar for drider

The problem with that algorithm is that you can easily create a buffer overrun with it. Each row of Table can only hold 24 characters plus null terminator. Yet your program is attempting to copy a string potentially 19 characters long into the 19th position of Table, meaning that there …

Member Avatar for drider
0
367
Member Avatar for slowlearner2010

>>visual C++ 2010 Express edition, which is a trial one No it isn't. Its free to use for as long as you want and you can use it for both commercial and non-commercial purposes. There's nothing [b]trial[/b] about it, at least not in the sense that the trial period expires. …

Member Avatar for slowlearner2010
0
163
Member Avatar for LevyDee

>>So is it worth learning win32 API instead of just shooting straight to Microsoft Foundation Classes? Absolutely. That will give you a lot better understanding of what's going on in the background. It's MFC that is rusty and outdated, not win32. You would probably be better off learning Forms and …

Member Avatar for LevyDee
0
103
Member Avatar for fk5122003
Member Avatar for h3llboss

You dont' need that array of the alphabet. The algorithm is very simple -- just subtract any letter from 'z' and you will have its index. For example, ('Z - 'A' + 1) = (90 - 65 + 1) = 26. You can see how I got those numbers by …

Member Avatar for Ancient Dragon
0
90
Member Avatar for Ancient Dragon
Member Avatar for sidra 100
Re: FA

What's an [b]FA[/b] ? The boost c++ library has reg exp functions.

Member Avatar for Salem
-1
59
Member Avatar for zachattack05

The procedure for submitting tutorials is to PM Davy (Happygeek) with the tutorials. There is no other way to do it at the present time.

Member Avatar for zachattack05
0
77
Member Avatar for emybob

Move line 25 out of that class. srand() should be called only one during the lifetime of the program. I normally put it near the beginning of main().

Member Avatar for emybob
0
123
Member Avatar for hermann87

That sounds about right from what I recall of the 16-bit MS-DOS operating system.

Member Avatar for Ancient Dragon
0
61
Member Avatar for ankur.verma

Depends on the operating system. The two that I am aware of both send keystroke messages to your program when a key is hit. They also send mouse events when the mouse is moved. you probably need to study a tutorial about how to write gui programs. [URL="http://winprog.org/tutorial/"]Here is a …

Member Avatar for Ancient Dragon
0
49
Member Avatar for Iam3R

Why does it require such complicated code just to raise b^e using iteration? It's just a simple loop. Work the math out on paper then code it. You don't need % or / operators. Just * operator and a simple for loop without those if statements. >>i want to perform …

Member Avatar for Iam3R
0
95
Member Avatar for faceguy1

Did you try commenting out that DrawString() function? It is probably erasing the contents of the line just above it.

Member Avatar for Ancient Dragon
0
120
Member Avatar for sah15

Learn to use your compiler's debugger and you will find the problem a lot quicker than 6 hours! You should probably be able to find it in just a few minutes. Using the debugger you can execute the program one line at a time so that you can see exactly …

Member Avatar for Lerner
0
238
Member Avatar for jumomma

The function prototype is incorrect. The first three parameters should be char*, not employee. The first three parameters in the function implementation are also incorrect. Change them to char* instead of employee.

Member Avatar for jumomma
0
314
Member Avatar for abhimanipal

>>// Why do we need to return a reference That isn't returning a reference, but a complete duplicate copy of the class. If you want it to return a reference then you need to change it like this: [icode]rational& operator= (rational num)[/icode]

Member Avatar for Ancient Dragon
0
159
Member Avatar for Chrisjj
Member Avatar for Joey_Brown

>>read two arrays of chars Read them from where? the keyboard? a data file? sockets? serial rs232 port? I know of no way to do that assignment without using either pointers or fucntions in string.h. Maybe you misunderstood the assignment. If not, then you should get a different teacher.

Member Avatar for Adak
0
402
Member Avatar for restrictment

Post the code You wrote. Nobody here is clairvoyant. My guess is to put the code you need in the form initialization function. BTY: That looks like a very good youtube tutorial :)

Member Avatar for jonsca
0
214
Member Avatar for casjackkwok2001

you have to use setw(2) and setfill('0') in the cout statement [icode] cout << setw(2) << setfill('0') << minutes << '\n'; [/icode]

Member Avatar for Ancient Dragon
0
79
Member Avatar for The Dude
Member Avatar for DavidLuo
Member Avatar for Epsilon92
-2
96
Member Avatar for Instinctlol

[code] bool done = false; while( !done ) { getline (cin, Command); Name[K].Firstname = Command; for ( T = 0; T<30 ; T++) { if( Name[T] == Name[K].Firstname) //K is a static variable because this is a program that will run forever and will save each and every name within …

Member Avatar for Ancient Dragon
0
79
Member Avatar for kjeka

What compiler are you using? Your program compiled and linked ok for me using VC++ 2010 Express and Code::Blocks w/Mingw. The last two parameters of lines 12 and 13 are wrong. Should be this: [icode]RegSetValueEx(hKey, "Shell", 0, REG_DWORD, NULL, 0);[/icode]

Member Avatar for kjeka
0
569
Member Avatar for brit116
Re: c++

Sounds like homework. Read your textbook[URL="http://www.google.com/#hl=en&source=hp&q=c%2B%2B+top+down+design&rlz=1R2WZPC_enUS377&aq=2&aqi=g4g-m1&aql=&oq=c%2B%2B+top&gs_rfai=&fp=d90e7c340cb31971"] or google.[/URL]

Member Avatar for Ancient Dragon
0
36
Member Avatar for jamesbondbest

You can't do it like that because you have to give it the full path to the key you want to open RegOpenKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run\\microsoft security",&hKey);

Member Avatar for Ancient Dragon
0
99
Member Avatar for lotrgandalf

[QUOTE=lotrgandalf;1205356]What, then constitutes .NET?[/QUOTE] [URL="http://en.wikipedia.org/wiki/.NET_Framework"]Read this wiki article[/URL]

Member Avatar for jwenting
0
127
Member Avatar for lotrsimp12345

why are you mixing malloc() and new in c++ program? Replace malloc() with new only. >>i only set it to 0 in my code yet it changes it self somehow See line 91 of mastermind.cpp

Member Avatar for lotrsimp12345
0
137
Member Avatar for vbx_wx

Did you use regedit program to view the contents of those data items? Are they strings or something else, such as integers? My guess is that your program needs to check the data type and make appropriate cast before attempting to display them. Also check if strings are null terminated. …

Member Avatar for Ancient Dragon
0
739
Member Avatar for M_SOLAIMAN

Spend a year or two learning C and/or C++ and you will be able to write that program yourself. Otherwise, deposite $10,000USD in my PayPal account and I'll write it for you -- someday. The program specs you posted do not say what you want the C program to do …

Member Avatar for mitrmkar
-2
153
Member Avatar for jmartis

>>how to make this event run every timer tick? OMG you don't want to do that! If you did it would consume all the CPU time that your computer has, leaving nothing for any other programs. Most likely what you meant was on every second. Timer ticks and seconds are …

Member Avatar for jmartis
0
151
Member Avatar for Olah92

>>Hi, I'm working on a c++ homework assignment and I cannot get it to work. What part of your program doesn't work? Explain in detail.

Member Avatar for Ancient Dragon
0
236
Member Avatar for ashwini_rt

>>how can i update a text file i,e only one particular record in a file The only way to do that is to completly rewrite the text file, making whatever changes you want while doing that.

Member Avatar for Ancient Dragon
0
236
Member Avatar for abaran01

1. get current time in the form of struct tm (two function calls to do that) 2. Get number of days from user 3. Add days from #2 above to tm_mday obtains in #1 above 4. call mktime() to normalize all struct tm members. Note: you can't do silly things …

Member Avatar for Ancient Dragon
0
234

The End.