15,300 Posted Topics
Re: If you are uisng VC++ 2005 or 2008 then you can't use iostream.h at all. That file is obsolete and has been replace with <iostream> And yes, you can have stdio.h and <iostream> both in the same program. | |
Re: this is a c++ program, so use c++ classes [code] #include <string> #include <iostream> #include <vector> using namespace std; int main() { vector<string> arry; ifstream in("filename.txt"); string word; while( in >> word ) { array.push_back(word); } } [/code] But, in your example [icode]while (myfile>>a[names]) [/icode] should be [icode]while (myfile>>a) [/icode] | |
Re: What you are doing is a very aukward and poor design. I think you are approaching this all wrong. why not just use dynamic arrays, such as std::vector, which can contain as many i78tems as you want without resorting to rewriting the function and recompiling the program every time. | |
Re: Yup, there's lots of pork on all sides of the fense. Like the Mid America Airport not far from where I live -- its an expansion of Scott AFB (Air Force Base). It was great for Scott AFB, but that's about all. It was originally supposed to suppliment Lanbert International … | |
Re: [QUOTE=Narue;692395]Congratulations, muraliaa! It took you only [b]four years[/b] to come up with the same answer as me.[/QUOTE] Some people are just a little slow :) | |
Re: The trick is to use [b]fixed[/b] [icode]c1 << fixed << setw(6) << Total; [/icode] | |
Re: >>I checked about SetSuspendState() in DaniWeb, and googled it, but came up with nothing. Not supprised about DaniWeb, but [URL="http://www.google.com/search?hl=en&q=SetSuspendState&btnG=Google+Search&aq=f&oq="]google had lots of links[/URL] Always either search MSDN or google for all win32 api functions, and they will give you detailed information. [URL="http://msdn.microsoft.com/en-us/library/aa373201.aspx"]Here is the information you need.[/URL] | |
Re: I compiled/linked your program without any warnings or errors. Maybe you need to move the source code to a folder whose name does not contain any spaces, such as c:\dev-cpp\source | |
Re: It takes a loooooooooooooong time for it to defrag a hard drive -- expect it to work for a couple hours depending on the size of the hard drive and how full it is. If the hard drive is nearly full then defrag won't be able to do much with … | |
[URL="http://www.worldcommunitygrid.org/index.jsp"]World Community Grid[/URL] is similar to Folding@Home. I have created a new DaniWeb team account that everyone is welcome to join. You can have both Folding@Home and World Community Grid running on the same computer. I started this new account because I was disassitified with the software available at Folding@Home. … | |
Re: You need to study a windows tutorial to understand that. There is no single function. [URL="http://www.winprog.org/tutorial/"]This tutorial[/URL] will tell you how to add menus to your windows programs. | |
Re: maybe [URL="http://support.microsoft.com/kb/921469"]this article[/URL]? | |
Re: There are differences. You can not copy the registry from XP to Vista or vice versa. | |
Re: line 323: According to line 17 length_iter() requires an array of characters. passijng *_string only passes a sincle character, not the entire array. And rstring is not an array of characters, but a reference to a single character. I think what you want is this: [code] void SString::operator+([color=red]const char* [/color]rstring) … | |
Re: I don't know how you did it, but I do know the code you posted can't compile cleanly. For example the loop that starts on line 35 is all wrong. It could be written like this (or use whatever string comparison function you wish). [code] for(i=48; i<size; i--) { if( … | |
Re: >>(I have no idea what that means) time() is a function that's declared in time.h (or in c++ <ctime>). It returns an unsigned integer that contains the number of seconds that has elapsed since some predetermined date -- it used to be Jan 1970, but I'm not sure if that … | |
Re: ^M is a carrage return -- '\r-- which is used to deliniate end-of-line on some operating systems. If you are transferring the file from *nix or MAC to MS-Windows then you need to replace it with "\r\n". | |
Re: [b]sql[/b] Do you mean Microsoft SQL Server, or do you mean the SQL language? | |
Re: It will help to know what the error messages are. I'm supprised those compiled with a MSWindows compiler. You can't leave both dimensions of the arrays unspecified [code] void printOctets(int octets[10][], char []); void printInterval(int suntwk[10][], int brdc[10][]); [/code] | |
Re: line 5: [b]class[/b] is misspelled. line 8: you must specify a length if you want to use a character array. If you want to use dynaming array allocation then use a pointer -- [icode]char* _string;[/icode] line 49: you must end the class declaration with }; The constructor with two parameters … | |
Re: 1) I would create a structure that holds the count and string for each word [code] struct words { std::string word; int count; } [/code] Now have a vector of these structures [icode]vector<words> wordList;[/icode] Now when you get a word, search the vector for occurence. It its already in the … | |
Re: Microsoft Visual C++ 2008 Express is free and the newest of the M$ compilers. | |
Re: try [URL="http://www.google.com/search?hl=en&q=integers+with+infinite+precision&aq=f&oq="]these google links[/URL] ![]() | |
Re: Lines 27 and 28 can only appear in ONE *.cpp file -- doesn't matter which one. Remove those lines from the header file. | |
Re: After getting the two file names if they are the same open the two files with normal streams then read them one character at a time. | |
Re: function getData() 1) You did not open the file. I suggest you use ifstream instead of fstream because I think its easier to use. [icode] ifstream file("MenuData.txt");[/icode] You didn't post the contents of the data file so I don't know how it should be read. But I'm sure its not … | |
Re: you have a dvd class that contains string objects. Why are you writing your own string class when there is a perfectly good std::string class? | |
Re: One reason that happens is because you compiled your program for debug instead of release. More than likely the computer you installed your program on does not have the Microsoft debug DLLs. Compile for release mode and retest. | |
Re: The code you posted doesn't compile cleanly. | |
Re: That has been discusses at length in other threads. Seek and yea shall find. | |
| |
Re: temp.a is NOT a pointer, so line 18 can't work. [code] int x=0; for(x=0;x<=9;x++) { n->a[x] = *b1++; } [/code] | |
Re: [QUOTE=stilllearning;689581] Also [URL="http://www.mattjustice.com/cnotes/c_fileio.html"]here[/URL] is a C File I/O tutorial to help you get started.[/QUOTE] link is broken | |
Re: check the Recycle Bin and see if the os moved the files there. If they are there then you can just simply restore them. | |
Re: Better to buy a good book -- it will last longer and you can easily read/reread as often as you want. Books are also very handy to keep at your side while programming. You can look things up in a book while you can't do that with a video without … | |
Re: Are you able to compile/link the example/test files that come with the MySQL++ distribution? I have the distribution for MS-Windows, using a different compiler, and have no problems with the sample/test programs. | |
Re: try the same thing in a single threded program and you will probably get the same or similar results. | |
Re: Since CountVowels() returns an integer, then the OUT parameter must be a pointer [icode]int CountVowels (char text[], counter_t* Count);[/icode] I don't know what integer that function is supposed to return -- certainly not a counter_t object because that isn't an integer. If you make the second parameter a pointer as … | |
Re: Your first code prints c++ for me using VC++ 2008 Express. What compiler are you using? | |
Re: Use your compiler's debugger, put a breakpoint on that function, and find out why it prints the wrong day of the week. My guess is that dayNum is wrong -- Sun should be 0, but dayNum may use 1 for Sunday. | |
Re: My suggestion: toss it into the trash can and get another computer. Or if you're the techi type you might try replacing the motherboard. | |
| |
Re: Read in your textbook or online about the parameter to ins.get() -- it takes a pointer and you are passing a char. Whenever you get an error like this one you need to look up the function in your textbook or google for it so that you can verify for … | |
Re: don't use strtok() on std::string objects because strtok() will put 0s in the string which will invalidate the std::string object. The c++ way to achieve this is [code] int main() { string str = "123 Mike November,12 1990"; size_t pos = str.find_first_of(" ,"); while(pos != string::npos) { cout << str.substr(0, … | |
Re: >>Somehow seems as if the "stdio.h" doesn't recognize the type File That's correct because there is no such thing in stdio.h -- its FILE (all caps). | |
Re: Urgent for you maybe, but not for me. Just what do you want us to do with those requirements ? BTW: you failed to post the equation that calculates BMI | |
Re: Please quote the exact problem because what you posted doesn't make a lot of sense. One possibility is this: [code] void foo( int a, int b, int c, int*sum, int* average) { } [/code] | |
Has anyone been able to compile the lib files using Microsoft Visual C++ 2008 Express compiler? I downloaded and installed MySQL 5.0 Server yesterday, then downloaded MySQL++ source. Attempted to compile and got a bunch of link errors. I used dumpbin.exe to get a list of all the symbols in … | |
Re: [URL="http://www.codeproject.com/KB/aspnet/AJAXUpload.aspx"]Read this article[/URL]. I don't know if it will help you or not. | |
Re: [URL="http://www.google.com/search?hl=en&q=how+to+play+media+files+in+windows+ce&aq=f&oq="]have you used google to search for the solution to your problem[/URL]? [URL="http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsce.embedded&tid=356c5a4f-0d38-4dc3-af9e-5844121667d2&cat=en-us-msdn&lang=en&cr=US&sloc=en-us&m=1&p=1"]Here is an interesting thread [/URL]in Microsoft support site. |
The End.