15,300 Posted Topics
Re: just how long does it take your compiler to compile a small C program anyway? What version of MS-Windows or MS-DOS is running on your computer. How fast is the hard drive and RAM ? Have you run a virus scanner and a SpyWare scanner ? If your computer is … | |
Re: did you try [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=free+ringtones&spell=1"]google[/URL] ? I don't use a cellphone so I have no idea where to get them. | |
Re: [QUOTE=iamthwee;339762]Gah, c++.net, horrible. Much prefer pure c++.[/QUOTE] I agree, but that doesn't help to solve the problem. I don't have that compiler so I can't help either. I think M$ rewrote all CLR libraries between .NET 2003 and 2005, so attempting to compile with 2005 if fruitless. | |
Re: >>any ideas how to fix it? fix what? you didn't say what's wrong with the code you posted. why does isLeapYear() take a double as parameter? It should be an integer; afterall years do not contain fractions. | |
Re: MFC has a class that's almost like Notepad. All you need to do is use either VC++ 6.0 compiler or VC++ 2005. About all you have to actually code is the menu items. Don't know a thing about your dictionary question. | |
Re: just use fgets() to get the team name from the keyboard. You are experienced enough to have written all that complex code so surely you should be able to easily figure out how to use a simple function like fgets(). | |
Re: Finally got it to compile by removing the code you have after the class declarations and reformatting to make it easier to read. Don't be afraid of using spaces in your program -- crunching everything up like you have it makes debugging difficult if not sometimes impossible. [code=c] #include <string> … | |
Re: you could use std::string class and just concantinate the value with the string [code] std::string query = "SELECT * FROM table1 WHERE id = "; query += value; [/code] now the problem is that if [b]value[/b] is a string you will probably have to enclose it in quotes [code] std::string … | |
Re: delete line 3 -- that file (iostream.h) is for C++ programs, not C programs. | |
Re: >>But it looks like its not portable Of course not -- its only for MS-Windows :) [URL="http://www.winprog.org/tutorial/"]Tutorial here[/URL] | |
Re: first you need to post the code you have already written. The answer to your question depends on what kind of strings you are using -- std::string class or character arrays ? | |
Re: line 11 may or may not work even though it would appear to us that it should. The reason is because many floats can not be represented exactly in memory due to the way [URL="http://en.wikipedia.org/wiki/IEEE_754"]IEEE math works[/URL]. The best you can do is check for a range of values instead … | |
Re: people who don't want their location known should not use the internet. anyone that parinoid should keep their head. Giving out critical personal information such as SSAN, banking and credit account numbers, etc is certainly illegal. But I don't see the harm in knowing what city someone is at. | |
Re: In your example if you enter "205" you will get nothing because there are no lines that contain "205" :) But I understand what you mean anyway. >>pls include the codes Please first post your code to show us the effort you are making to solve the problem. I would … | |
Re: >>>>i want to binary write a class-struct which contains a string me you can't write it out all in one write() function call like you can structures that contain char arrays. You will have to write the members of the class individually. Here is how to write fixed-length strings, but … | |
Re: >>Hi all...my first post here...WOOHOO!! Ok...now to the meat of the question Welsome to DaniWeb.:) Hope we see a lot more of you here and there. Please visit the Coffee House --> Community Introductons and tell us about yourself. maybe you should read one of the [URL="http://pw1.netcom.com/~tjensen/ptr/pointers.htm"]pointer tutorials[/URL] you can … | |
Re: [code] while (datafile) { datafile >> row >> col; } if ( row>=0 && row<Size && col>=0 && col<Size) // if legal row-col Grid[row][col] = true; [/code] In the above code you need to move that if statement to be within the while statement. As it is, your program reads … | |
Re: there is no use for [b]iostream.h[/b] because it is obsolete. use [b]iostream[/b] instead (without the .h extension) assuming your compiler supports it. Old compilers such as original Turbo C++ may recognaize iostream.h. It defines the c++ iostream classes -- output text to the console monitor. | |
Re: I have a secret to tell you if you promise not to tell anyone else -- I don't like American footfall either. :eek: European football (we call it soccer) is a lot more exiting to watch, but we don't get much of it over here. | |
Re: you should never actually declare variables in header files because if you have two or more *.c files that include that header file the compiler linker will issue [b]duplicate objects[/b] errors (or something like that). To get around that problem, in header files use the [b]extern[/b] keyword, as in bala's … | |
Re: > anyone got anything for me don't be so impatient. I'm watching TV (House) at the moment > `cin >> movie;` don't use that. use getline() function instead when movie is std::string getline(cin, movie); or when movie is char array cin.getline( movie, sizeof(movie)); | |
Re: any conditional statement that is either true or false. for example if you were asked to enter either 'Y' or 'N' (Yes or No) then the statement might read [code] if( answer == 'Y') { // true statement } else { // false statement } [/code] | |
Re: I would use a flag to indicate the end of a paragraph -- the first blank line is the end of the paragraph. When the flag then indent the next non-blank line and reset the flag to false. The while loop is better written like this [code=c] while( getline(inFile,inputStr) ) … | |
Re: do the assignment one step at a time. First think about what data items you want to put in the structure. What kinds of things do you want to know about each lecturer? Maybe you need his/her name, lecture date/time, class number, etc. Then crete the structure with these items. … | |
Re: same answer as given in [URL="http://www.daniweb.com/techtalkforums/post333796.html#post333796"]your thread[/URL] 4 days ago, and it has not changed since then. | |
Re: I had that same question some time ago and was told that templates can't be exported in a DLL. So I just use a pragma to disable that warning because the class will work anyway. [inlinecode]#pragma warning(disable: 4251)[/inlinecode] | |
Re: search the [b]Code snippets[/b] for [b]fopen[/b] because there are several example, such as [URL="http://www.daniweb.com/code/snippet151.html"]this one.[/URL]. If you read the docs for the [b]fopen[/b] function it will show you which flags that are needed to actually create the file first if it doesn't exist. | |
Re: why did you not post function insert() ? Is that the function you have the question about? if you want to copy one structure into another you can use memcpy() function to copy everything in one bang. | |
Re: please post code because we have no clue what you did | |
Re: I believe TC3 compiler supports dos.h and I think it includes _dos_findfirst() and _dos_findnext(). [URL="http://www.delorie.com/djgpp/doc/libc/libc_166.html"]Here is an example program[/URL]. | |
Re: what compiler are you using? I tried to compile it with three diffeent compilers and none of them knew about strptime(). | |
Re: I was terrible at it -- only guessed 4 correctly. And Joe they did tell me which ones were fake and real (maybe because I did so poorly???) | |
Re: It would definitely be to your advantage to have at least a fundamental knowledge of assembly if for no other reason than to know how programs are run at the machine level. Assembly language is not nearly as relevent in today's 32-bit environments which gobs of ram and fast hard … | |
Re: If you download the source code in that link I posted it will show you how to get the processes. Getting the process list is NOT MFC. The part of that project that uses MFC is displaying the results. | |
![]() | Re: why use qsort() ? use the c++ sort() that's in algorithm header file. I don't know if qsort() works with vectors. |
Re: sorry -- we are not a software factory. | |
Re: [URL="http://www.codeproject.com/threads/w32process.asp"]Example here[/URL] | |
Re: read the [b]Read Me[/b] threads at the top of this board. They are filled with useful FAQ and other links for new want-to-be programmers. | |
Re: line 45 should be like this: (use the value object) [inlinecode] outputStream << value.real;[/inlinecode] | |
Re: you have a couple options: 1. use strtok() in a loop to extract the individual strings and copy the text into another string array. 2. use a pointer and strchr() to locate each colon then copy the text into another string up to the pointer that was returned by strchr(). | |
Re: windows.h contains all the functions you will need for win32 api programs. If you have used functions in graphics.h, then forget everything you learned because ms-windows programming is completly different. | |
Re: Hllarious and in the true form of Benny Hill :cheesy: :cheesy: :cheesy: | |
Re: VC closes the console window when the program ends. If you want to see the program's output you have to add something before the return to make the program wait for you to press a key before continuing. calling cin.ignore() just before the return statement will accomplish that. | |
Re: you need to pass the vector by reference, not by value. like this: [inlinecode]void fillArray(vector<int>[color=red]& [/color] list, int length)[/inlinecode] [edit] Sorry Joe, I didn't see your post before I posted mine [/edit] | |
Re: The code contains an error -- it accesses an element of the array that does not exist, which probably explains why one of the results is 0 instead of 7. Anyway, the reason for the strange arrangement of the final results is that the function only sorts part of the … | |
Re: Add a switch statement after line 44 that will execute the desired action. then put lines 30 to 44 (and code you add in the switch statement) into a do or while loop so that it can be executed more than once. | |
Re: If the client is MS-Windows and the server is *nix then you have [URL="http://en.wikipedia.org/wiki/Endianness"]Big Endian-Little Endian[/URL] proglem The easiest way I know to correct it is to transfer the data as ascii text then use atol() or similar function on server side to convert back to integer in its own … | |
Re: people may want to view your doc file because they can contain viruses. I only write programs for other people for a fee -- and lots of it. If you want to pay someone to write the program then post in the [URL="http://www.daniweb.com/jobs/forum95.html"]job offers board.[/URL] | |
Re: When I installed Vista Home Premium upgrade on d: drive it left the XP Pro on c: intact and now I can boot with either os (dual boot) |
The End.