15,300 Posted Topics
Re: dllexport and dllimport are only used in DLLs. You don't use those keywords to refer to functions that are contained in other source files that are linked with the project. in main.c you need to prototype the function that is included in a different *.c file using [b]extern[/b] keyword. Below … | |
Re: you failed to prototype function myf() before it was used, so the compiler make an incorrect assumption that it returned an int. Add the function prototype [b]double myf(double x);[/b] before function main but after the includes. And thank you for using code tags to make your code easy to read.:) | |
Re: please post code so we don't have to guess what you are doing. But basically its like this [code] char string[] = "Hello World"; int len = strlen(string)-1; while(len >= 0) printf("%c",string[len--]); [/code] | |
Re: >>C and C++ should be abandoned you don't have to use C/C++ if you don't want to, but don't expect everybody else to do so. Writing windows GUI programs is just a small part of the software design/programming efforts. And in some operating systems C and assembly language are the … | |
Re: don't know why you would want to do that it will just make your program more difficult, but you could create arrays of each object now is the structure. Lets say you need arrays of 255 items. [code] pid_t pid[255]; int length[255]; char buff[255][128]; [/code] | |
Re: you need to add the parentheses so that the compiler will know it is calling a function. [code] randomno = randgen[color=red]()[/color]; // Generate random number [/code] >>it has a variable double register random do you mean you declared it like this ??: [code] register double random; [/code] All of the … | |
Re: since this is a normal windows program you could replace sleep with a timer (see SetTimer() in MSDN) that is triggered every xxx milliseconds, and move call to refreshAutoAway() inside the timer event handler. Then replace that loop with the message pump, calling PeekMessage(), which will block your program until … | |
Re: what was the error? please copy from window and paste to your post. Since you are subclassing a standard MFC control your dll should be an "MFC Extension DLL". I have never successfully exported that type of class from a regular DLL. Also, I suspect you did not import the … | |
Re: [QUOTE=peter_budo;266282]I think everybody hate when his phone/mobile ring, you pick up and hear that you just won some kind of Grand Price. [/QUOTE] That really makes be glad I do not own a cell phone:mrgreen: I get enough commercials from TV, radio and spam e-mail. I don't have to put … | |
Re: Great avaitor! I feel like that quite a bit.:mrgreen: :mrgreen: | |
Re: why are you responding to a year-old thread??:eek: :eek: I doubt the OP is interested in it any more. | |
Re: There is lots of on-line help for the pow function -- such as [URL="http://www.die.net/doc/linux/man/man3/pow.3.html"]this[/URL] one. [code] while (theFile >> number) { cout << number << "\n"; } [/code] that will read every number in the file, assuming the file contains no other strings. The program will store evey number read … | |
Re: I hate to say this, but you can start by reading your textbook and paying attention in class. We have no idea what you are supposed to do either because you did not mention what computer language, operating system and/or compiler you are studying. Once you have figured that out … | |
Re: what version of MS-Windows is your computer running? I assum you are tring to install VB .NET 2005 (Express edition?) Go back to the Microsoft download page and read about system requirements -- make sure your computer meets or exceeds those requirements. | |
Re: >>1. I don't know why when I enter the number in, when it prints out the number which function has that problem? >>2. I don't know whether my checking part can really check the numbers have repeated or not Why not make that check at the time a number is … | |
Re: If you expect an answer you will have to post some code and show your attempts to solve the problem. | |
Re: A couple observatons: 1. variable font needs to be a member of a class and not allocated on the stack so that it will not get auto destroyed when the function returns. 2. You probably need to typecase it [code] GetDlgItem(IDC_FONTID)->SetFont(reinterpret_cast<CFont*>(&font)); [/code] | |
Re: I see we can get it as a screen saver too! Looks like it would be worth the $50.00 or so. | |
Re: there are 255 characters in the ascii character set (only about half are printable), so all you have to do is create an int array of 255 and use the char as an index into that array. When all done, loop through the array and print out the values for … | |
Re: I would input everything info one big string then parse the string to find out how many words where are. If it contains the correct number of words then it can be broken into its individual parts. | |
Re: You cannot write directly to an *.xls file and expect Excel to read it because *.xls files are not plain text files -- they contain a lot of formatting information that is readable only by Excel program. The easiest way to do it is to creates *.csv files which Excel … | |
Re: >> char tmp[10]; tmp is too small -- increase to at least 20. Lets say I enter a string of 18 characters, the line tmp[len] = '\0'; will cause program crash. [edit]Other than the above problem your program seems to work ok. I didn't check every line of the output, … | |
Re: This has got to be the worst job of posting I have ever seen anywhere on the web! If you won't make the effort to post something readable then nobody is going to make the effort to respond to your question. If you don't know how to use code tags … | |
Re: Another option you might consider is standard ODBC which will make your program more portable to other compilers should you ever decide to change compilers. There are a number of free c++ ODBC class you can download off the net. | |
Re: there are two formas of function getline -- one for c-style character arrays and the other for std::string objects. You are trying to use the incorrect one. Here's what you need: [code] getline(cin,playerOne); [/code] | |
Re: post one of the rows so we can see what kind of items it has. Generally, if they are all strings (or words). Assuming the name of the stream is [b]in[/b] [code] std::string word; while( in >> word ) { // blabla } [/code] | |
Re: >> f the parameter dance is translatable, the function sets instructions to the translation of the dance, I have no idea what that is supposed to mean. You should have been given clarification in class or in your textbook. Well, I see from google that it is some sort of … | |
Re: >>We cannot have static friend function............ who told you that mis-information???? Is below the sort of thing you are talking about? My compilers do not have a problem with [b]static friend[/b]. And if you google for "static friend functions" you will find more info about it, such as [URL="http://www.thescripts.com/forum/thread539425.html"]this[/URL] thread. … | |
Re: post the declaration of variable [b]word[/b]. It should be [code] char word[some_value]; or char *word; [/code] | |
Re: that link crashed my computer. I had to turn the computer off, | |
Re: please edit your post to use code tags per[URL="http://www.daniweb.com/techtalkforums/announcement8-3.html"] these[/URL] instructions. And please post a few of the errors. | |
Re: look at the menu options -- there is probably an option to compile for release or debug. You arle probably compiling for relase, which does not contain the information needed for you to single-step through the program. | |
Re: why not just buy a DVD R/W ? I got one a couple weeks ago at Best Buy for about $80.00 (US) | |
I have read several (numerous really) threads but none of them help me. My computer has two huge hard drives. I have Windows XP on the master drive and I want to install fedora 5 on the slave. During the fedora installation there is a window that says grub will … | |
Re: >>so let me know if it's even doable Absolutely and most definitely YES. We do it all the time. just pass the name of the array. Here is a simple example. [code] void foo(int array[]) { // blabla } int main() { int array[10]; foo(array); return 0; } [/code] | |
Re: Here is a starter. I would create a structure for the two strings, then array of that structure. [code] #include <iostream> using namespace std; struct states { char *stname; char *stabbr; }; states st[] = { /* State abbreviation*/ "North Carolina", "NC", "South Carolina", "SC", "Georgia", "GA", "Florida", "Fl", "Alabama", … | |
Re: [URL=http://vetusware.com/download/TASM%205.0/?id=65]TASM 5.0[/URL] is a MS-DOS 6.X and earlier 16-bit assembler and will not assemble 32-bit code that is needed for MS-Windows. | |
Re: I'm not supprised -- it is probably stack overflow problem with all those recursive calls and putting all those huge arrays on the stack. Try putting that array in global memory, outside any function and maybe use a non-recursive algorithm. | |
Re: a) I suspect you are attempting to use 16-bit borland graphics functions with a 32-bit compiler? If not then I have no idea what you mean. You will have to post actual error message(s) b) a pointer is just the address to the beginning of an array. Of course there … | |
Re: Welcome -- we are happy to help all programmers regardless of your major in college. All you have to do is ask a lot of questions and post code that show problems. | |
Re: If you are talking about true MS-DOS than it is not possible because MS-DOS is not a multi-tasking operating system. When your program runs there will be no other programs running on the computer. If your computer is running any version of MS-Windows then you will not be running MS-DOS, … | |
Re: see sizeof() operator -- but the size of a pointer is always the same on 32-bit compilers. | |
Re: >>hey,, i'm joyce, newbie Welcome to DeniWeb. Please go to the CoffeeHouse and tell us about yourself. As for your problem if it were me I would convert the integer to a character string then just print the string backwards. You can use sprintf() to make the conversion. | |
Re: [QUOTE=xyfay;261865]God will bless you~gustylow. You will get the best present- a lovely baby and what do you think about your baby's name?[/QUOTE] Yes, you will have to let us all know when the happy event occurs:) As for a name -- hummm -- maybe DaniWeb :mrgreen: And welcome to the … | |
Re: I compiled and ran it with Dev-C++ and it seemed to work ok. The only change I had to make was to flush the input stream after selecting a menu. You should not use scanf() especially with strings because it will allow you to type more characters than the input … | |
Re: I get similar error sometimes if I did not include the correct header files and something has not been defined. DaniWeb does not allow us to use our crystle balls to see your program so I you will just have to post it. | |
Re: I guess I'm fortunant because I'm 63 and still have a full-time well-paying job. I have to wait until I'm 66 before I can collect full SS and I've thought about what to do if I do lose my job before then. Well, now I know.:mrgreen: | |
Re: ios646.h is apparently available in the C99 C standards. But I don't know how many compilers have implement those new C standards yet. | |
Re: first learn to open a file using fopen(), read a line from the input file using fgets() and write the same line to the output file using fprintf(). Once you can do that, come back and talk about how to actually split the file into two or more files. |
The End.