15,300 Posted Topics

Member Avatar for ayeshashahid

I don't ever use malloc() in a c++ program, its just too confusing to mix malloc() and new together in the same c++ program. Stick with new for consistency and to be less error prone.

Member Avatar for ayeshashahid
0
166
Member Avatar for corby

homework problem??? If so, then study about function pointers (or pointers to functions). Once you understand that then you will have the answer to your question.

Member Avatar for Narue
0
144
Member Avatar for PSP1202

There is nothing wrong with the for loop on line 25. What exactly do you want help with? (hint: you need to do more calculations within that loop. can't be done all on one line.)

Member Avatar for WaltP
0
112
Member Avatar for thunderstorm98

[quote][URL="http://en.wikipedia.org/wiki/Diwali"]Today it is celebrated by Hindus, Jains and Sikhs across the globe as the "Festival of Light," where the lights or lamps signify victory of good over the evil within every human being[/URL][/quote] The description sounds like its a very nice celebration, but I'm a little werry about the above …

Member Avatar for ~s.o.s~
0
240
Member Avatar for TheChosen0ne

copy the DLL into any of the folders listed in the PATH environment variable and it will work regardless of where the application program is located.

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for kikiritce

define it as a pointer and allocate memory to it at runtime [icode]MyArray DWORD 0[/icode] Exact syntax will depend on the assembler and computer you are using. And if Intel will depend on the memory model.

Member Avatar for Ancient Dragon
0
74
Member Avatar for SoftwareGuy

_T is a macro that converts a quoted string leteral to wide character, such as [icode]wchar_t something[] = _T("Hello World");[/icode] Never heard of _RT macro, and its not defined in tchar.h, where _T is declared.

Member Avatar for SoftwareGuy
0
247
Member Avatar for aFg3

Start out your program very simply, just create a program that does nothing more than read each line of the file and display them on the console screen. Once you have that compiled and working correctly you can add additional code to make the program behave as you have described. …

Member Avatar for Narue
0
192
Member Avatar for TheChosen0ne

check your computer's file system to see if alleg42.dll exists? If it does, is it in one of the folders listed in the PATH environment variable?

Member Avatar for Ancient Dragon
0
71
Member Avatar for Panathinaikos22

Maybe you need to lean how to search MSDN for what you want? Such as [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms647624(v=vs.85).aspx"]CreteMenu[/URL]() Or read [URL="http://winprog.org/tutorial/"]a tutorial[/URL] [code] HWND hw = CreateWindowEx(x,x,x,x,(HMENU),x,x,x), [/code] The above line does not create a menu. It creates a window that contains a menu.

Member Avatar for Ancient Dragon
0
172
Member Avatar for rchris2121
Member Avatar for muzaheed

There is no such thing as an "assembly compiler". Assembly programs are not compiled. They are just assembled. Two good assemblers for MS-Windows os -- MASM (a Microsoft assembler) and TASM (a Borland assembler) When you write assembly you are expected to "know your stuff" and not be spoon fed. …

Member Avatar for GunnerInc
0
106
Member Avatar for earth_observer

I used Windows 7 and did not have a problem with that code snippet, [code] #include <string> using std::string; int main(int argc, char**argv) { string arg1 = "one"; string arg2 = "two"; string command = "matlab -nosplash -r MyMatlabScript(" + arg1 + " " + arg2 + ");"; system(command.c_str()); } …

Member Avatar for Ancient Dragon
0
157
Member Avatar for Boeing

Depends on what you are programming? *nix? MS-Windows? QT? there are lots of others too. You need to be a lot more specific about what you are coding.

Member Avatar for Boeing
0
165
Member Avatar for Cross213

Depends on where you live and what kind of landline phone you have. I have a cordless phone and the phone number shows up on its display. But you will have to get with the manufacturer of your phone to find out how it works.

Member Avatar for Cross213
0
130
Member Avatar for rutwvu

cross posted [URL="http://forum.codecall.net/c-c/41323-linked-lists-type-justification.html"]here[/URL]

Member Avatar for Ancient Dragon
0
189
Member Avatar for Awais Ali

Maybe you should be reading [URL="http://www.tenouk.com/ModuleO.html"]a tutorial[/URL]

Member Avatar for Awais Ali
0
163
Member Avatar for eman 22

line 12: you can't use cin >> operator for strings that contain white space (space or tabs). To do that you have to call getline(), e.g. [icode]getline(cin,str1);[/icode]

Member Avatar for Tumlee
0
153
Member Avatar for cwarn23

I always enjoyed programming, especially the satisfaction of the many achievements working out problems. I only do things I like doing and leave the other tasks up to someone else because not only do I not like doing them but I'm woefully inept at the jobs. I didn't realize that …

Member Avatar for jackmaverick1
0
124
Member Avatar for diafol

maybe you needed to clear your browser's catch. Usually works for me.

Member Avatar for Dani
1
163
Member Avatar for adkool
Member Avatar for coolbeanbob

VC++ does the same thing. Just click the error message and the cursor will be moved to the offending line in the editor.

Member Avatar for coolbeanbob
0
267
Member Avatar for Panathinaikos22

It would also mean a 2 dimensional array. But I'd have to know what "...bla bla ..." says

Member Avatar for Panathinaikos22
0
121
Member Avatar for Iphicles

Salem already tried to help you in [URL="http://www.daniweb.com/forums/thread120491.html"]this thread[/URL]. If you can not understand the code he showed you then what you want to do is way beyond your current level of C knowledge. You probably need to study some tutorials about FILE and associated functions before attempting to continue …

Member Avatar for hellihdhs
0
220
Member Avatar for namratag

There are also other subtle differences. A program that runs ok when compiled in Debug mode may be broken when compiled in Release mode. One reason for that behavior is the way the compiler allocates memory for variables when compiled for Debug. Another reason may be over optimization in Release …

Member Avatar for Ancient Dragon
0
208
Member Avatar for Zssffssz

To copy to another location, open the file in binary mode then read/write 255 bytes at a time until end-of-file is reached. Another way to do it on MS-Windows is call win32 api function [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851(v=vs.85).aspx"]CopyFile()[/URL]

Member Avatar for vijayan121
0
175
Member Avatar for aKiLa.. :)

It will depend on the compiler and operating system. Tell us what you are using so that we can be more help.

Member Avatar for Ancient Dragon
0
233
Member Avatar for beaute

This works. First you have to export the functions in the DLL that you want to expose to the application program. Here I defined a macro named ADDITIONCLASSAPI so that the same *.h file can be used in both the DLL and application program without change. VC++ 2010 (and earlier …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for DSTR3

have you read [URL="http://www.w3schools.com/sql/sql_insert.asp"]this[/URL] tutorial? Not sure, but I think the INSERT statement is incorrect [icode]QLExecute ("INSERT INTO tblDownloads (DownloadIP , DownloadCount) VALUES('173.201.216.2', 1);");[/icode]

Member Avatar for Ancient Dragon
0
117
Member Avatar for namratag
Re: COM

They are not related. DLLs can contain [URL="http://www.microsoft.com/com/default.mspx"]COM programming[/URL].

Member Avatar for Zssffssz
0
87
Member Avatar for Mr. K

How many characters are on each of the lines in the file? Just 2 characters per line? That's all your program is reading. Post the first few lines of the text file so that we can see what's wrong with your program.

Member Avatar for Mr. K
0
211
Member Avatar for Chuckleluck

Check the WM_CREATE switch statement in WinProc() to see if the buttons are greyed out there.

Member Avatar for Fbody
0
168
Member Avatar for bops

g++ probably outputs error messages to stderr instead of stdout. try this: g++ "C:\HelloWorld.cpp" 2> "C:\output.txt" [edit]Oops! too late. ^^^ is right[/edit]

Member Avatar for swagatata
0
4K
Member Avatar for MARKGELZO21

srand() is used to seed the random number generator [icode]srand( time(0));[/icode] calling time() will make srand() seed with a different number each time the program is run. There is no such thing as an infinite character.

Member Avatar for Ancient Dragon
0
26
Member Avatar for mrnobody

Here is one way to convert it to integer. It may not work correctly if the string contains non-numeric digits so you will have to add some error checking. [code] #include <Windows.h> #include <iostream> #include <tchar.h> int _tmain(int argc, _TCHAR* argv[]) { BSTR bstrTemp = L"56"; int x = 0; …

Member Avatar for Ancient Dragon
0
93
Member Avatar for tomtetlaw

A program doesn't know how it was launched. Another program could have launched it by calling one of several C functions, such as CreateProcess(), system(), ShellExecute(), etc. Or it could be launched by some other non-C program using functions available to it for that purpose.

Member Avatar for tomtetlaw
0
151
Member Avatar for jingda

>>Anyone on daniweb now but not using a laptop I never use a laptop -- hate them. I just use a regular HP PC.

Member Avatar for cwarn23
0
198
Member Avatar for f4fjks
Member Avatar for UNDER-18 FG

>>char date of birth[15] There can not be spaces in the object names. One way to code it is to replace spaces with _ character [icode]char date_of_birth[15][/icode]

Member Avatar for hiddepolen
0
384
Member Avatar for TheNNS

>>I wonder what version of Windows Microsoft depreciated del *.* from the terminal. What makes you think it was depreciated? That command is still alive and well in Windows 7.

Member Avatar for Narue
0
636
Member Avatar for ajayb

My guess is that a semaphore is just a system DWORD since all it does is count from 0 to some maximum value. See [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms685129(v=vs.85).aspx"]this link[/URL]

Member Avatar for Ancient Dragon
0
109
Member Avatar for cyberguy007

seek to end of file, then get the file pointer. If 0, its an empty file. How to do that depends on whether you want to use fstream or FILE.

Member Avatar for sanof3322
0
30K
Member Avatar for mameemonster

lines 16 and 18 are wrong, you are passing a pointer to a single character not the whole string. Here's how to code it [icode]scanf ("%s", name[i]);[/icode]

Member Avatar for WaltP
2
440
Member Avatar for Zssffssz

you might find some stff [URL="http://www.codexxi.com/"]here[/URL]. Those old games you mentioned probably won't run on Vista or Windows 7 without also running [URL="http://www.dosbox.com/"]DosBox[/URL]

Member Avatar for Zssffssz
0
222
Member Avatar for Labdabeta

code between [icode]ifdef _cplusplus[/icode] and [icode]endif[/icode] require c++ compiler, such as make sure the file has *.cpp extension. If you are using a C compiler only then you can't make it compile that c++ code. I don't know a thing about your other question.

Member Avatar for mike_2000_17
0
163
Member Avatar for Labdabeta

[QUOTE=NathanOliver;1670615]An array's size is only limited to the memory of the machine running the code. [/QUOTE] It would be limited to the sizeof(std::size_t) See definition of the [URL="http://www.cplusplus.com/reference/std/new/operator%20new/"]new operator[/URL]

Member Avatar for rubberman
0
142
Member Avatar for mameemonster

What is "basics until array" exactly? We don't have your textbook so we have no clue what that means. I can guess, but that won't be much help to you.

Member Avatar for Ancient Dragon
0
73
Member Avatar for jaepi

I like to use [b]wcstombs()[/b] because it is pretty easy to use. There are, however, other more powerful fuctions that may be better used for some languages such as Chinese.

Member Avatar for epolgar
0
10K
Member Avatar for coder_10

use single quotes, not double quotes. Surround single characters with single quotes. t[0] = 'h';

Member Avatar for hkdani
0
201
Member Avatar for Salem

He was a brilliant man, I learned a great deal from his books and lectures.

Member Avatar for cwarn23
3
129

The End.