15,300 Posted Topics
Re: line 27 and 28: you failed to open the files [code] ifstream inData("myfile.txt"); ofstream outData("outfile.txt"); [/code] >>"too few arguements to function Carefully check and recheck the argument list in the function prototypes that appear at the top of your program with the parameter list that is passed on lines 37-40. … | |
Re: Error numbers mean absolutely nothing because they are compiler specific. Post the actual error message for those numbers -- most compilers print messages as well as error numbers. | |
Re: If you are calling that from some other function then expect to use the open file handle after that function returns, then the FILE pointer must be passed by reference. What you have coded is passing by value. [code] void OpenReportFile(FILE **reportFile) { *reportFile = fopen("c:\\temp\\report.txt","wt"); if (*reportFile == NULL) … | |
| |
![]() | Re: [QUOTE=sknake;962413]I hope so. Daniweb kills my iphone with all of the ads :([/QUOTE] make a monetary contribution and you won't get those ads. |
Re: [URL="http://msdn.microsoft.com/en-us/library/aa363915%28VS.85%29.aspx"]DeleteFile?[/URL] Just read about it at the link I posted -- it only has one argument. How hard can that be??? | |
Re: If you just want to add a new line of text at the end of the file, then open the file for append mode. Read about the [URL="http://www.cplusplus.com/reference/iostream/fstream/"]open method here[/URL]. Or call seekp() to set the file pointer to end of file before writing. If you want to add a … | |
Re: what os and compiler ??? Looks like TurboC code, but can't be sure. | |
Re: Find out the version of windows that is running then call LoadLibrary() if its the version you want. But what about all those calls to DLL functions? Are you going to put if statements around all of those too ? | |
Re: [URL="http://lmgtfy.com/?q=how+to+swap+two+variables+without+using+third+variable"]Link[/URL] | |
Re: >>I would like to work on POSIX thread programming using TC v3.0 You can't -- that compiler is too ancient. STL is supplied with a compiler because it is compiler-implementation specific. Your compiler doesn't have it because the compiler pre-dates STL. Upgrade to a modern compiler such as Code::Blocks or … | |
Re: why? If you are new to c++ you need to learn the language first. | |
Re: when you type [icode]g++ main.cpp[/icode] the compiler is going to compile main.cpp then attempt to link the executable. But it can't because it doesn't know anything about CBigInteger.cpp You can solve the problem by typing this: [icode]g++ main.cpp CBigInteger.cpp[/icode] | |
Re: Welcome to DaniWeb. Databases? Yes DaniWeb has several forums devoted to it -- they are listed under Web Development. Also questions about databases occasionally in the Software Development forums. | |
Re: 1) if you want a value between 0 and 9 then just use the mod operator [icode]int num = rand() % 10;[/icode] | |
Re: UNICODE characters is wchar_t, which on MS-Windows is unsigned short and on some other operating systems can be unsigned long. So why not just do something like this? [code] size_t i; wchar_t buf[20]; vector<unsigned long> characters; for(i = 0; i < characters.size(); i++) buf[i] = characters[i]; buf[i] = 0; [/code] | |
Re: [QUOTE=networkmancer;979526] I am not studying to any books or tutorials [/QUOTE] OMG You mean to tell us you learned to drive a car with your eyes closed :icon_eek: Get yourself an Into to C Programming book and [u]read it[/u] Or google for online tutorials and [u]study them[/u] It won't matter … | |
Re: Statistics class?? I'll bet you will find the answer in your textbook. It doesn't sound like a programming problem but something you can figure out in your head or with pencil & paper. | |
Re: >>I need to put this one in my case 5 Make a separate function out of that code then just call the function from case 5. That will make your program easier to maintain. | |
Re: What is the problem? Just use ifstream's >> operator and it will skip all white space (spaces, tags, etc) between words. >> How would i tell when the file ends when the loop below exits [code] std::string word; ifstream in("file.txt"); while( in >> word) cout << word << "\n"; [/code] ![]() | |
Re: [QUOTE=cscgal;978277]Test thread. :)[/QUOTE] >>Test thread :) Please ignore #1 Ok, I will :) | |
Re: [QUOTE=bharatkundur;979028]here is the solution to ur question this is one way to do the problem if its for only this no....... for all numbrs ill send u the solution in next reply[/QUOTE] No it isn't -- it is the wrong solution. You better read the problem again. | |
Re: c++ is not the best language for web sites -- use java instead. But if this is not for a web site then for gui I'd use wxWidgets or OpenGL. You could use pure win32 api but it would be more difficult. | |
Re: The printf() statement contains %s and %f, but there are no arguments for them [code] char message[] = "Hello World"; printf("%s\n", message); [/code] In the above, mssage is passed as an argument to printf(). Your printf() needs similar arguments. | |
Re: >>cube[i] = new CUBE; You can't use the new operator on a vector. All you have to do is use its push_back() method to add a new item. [code] CUBE* cb = new CUBE; cb->number = 0; cb->changed = false; cube.push_back(cb); [/code] But you can make your life a little … | |
Re: very similar, but you could fill in a struct tm with the date then call mktime() to fill in the rest, including the day-of-week. Make sure you memset the struct tm with all 0's before you start or mktime() will return an error condition. | |
Re: Not certain but WTL might be dead, and it was never officially supported by Microsoft. You are better off using wxWidgets, which is portable to several operating systems, compilers, and used by lots of programmers. There are also several tutorials that you can find with google. | |
Re: I don't see it in FF 3.5.1 | |
Re: That is sick -- no wonder our kids are so screwed up today, and it seems to get worse every year. Hope someone puts a XXX rating on that game so that only adults can buy it. Or better yet, just ban it. | |
Re: [quote]“security measures are inherently unreliable, can be trivially circumvented and will fail at high rates,"[/quote] I agree completely -- All you have to do to circumvent age questions is to lie about your age when asked. And porn sites have the same problem. Even asking something like SSN and looking … | |
Re: Never fear -- Wal-Mart is always there to suck up the slack by failing Circuit City and Best Buy. Our store just doubled the size of the hi tech sales floor area. | |
Re: This reminds me of a sci fi movie I saw years ago about everyone gets put to death on their 30th birthday because they are considered too old. | |
Re: Let me get this straight -- google is indexing stuff that is already online and in public domain. So tell me, how is it going to get stuff not online or in classified/confidential databases? I fail to see how that can happen. How can google index something that is only … | |
Re: As you quoted, the First Amendment appllies to government agencies, not private industry. The owners of websites can prohibit any kind of speech they want to without restruction because there are no laws to stop them from doing that. When at work, on company time, using company-owned computers, the company … | |
Re: Who the hell came up with that XXX thing anyway? It's a good idea, but one that will never work -- like trying to make prostitution illegal :D :D As for Marks/communism -- don't know and don't really care. They're pretty much irrelevent in today's world, unless of course you … | |
Re: I suppose what this article is about is that graphic cards have become too efficient. Games that played quite well with older and somewhat slower models of the cards look like crap on these new cards. A couple months ago my monitor died so I bought a new flat-screen monitor … | |
Re: Well, benna, just exactly what does "low impact" mean, without using the words "low impact" ? If you can't define it then you probably don't know any more than CNN what that means. Microsoft, and other IT people too, are good at throwing around meaningless terms (gobbledegook) | |
Re: I don't see how that bill will affect our energy consumption at all. I will still turn on the lights when the sun goes down no matter what time the clock says it is. And, if I were a farmer, the time change will not affect when I have to … | |
Re: I've been typing since before HS, in about 1958, and I've always used the original flat style keyboards. I hate those ergonomic split keyboards that benna loves -- I tried one at work once and couldn't type on it. The typewriters we learned to use in school had no letters … | |
Re: why should M$ care about sending security updates, or any other kind of updates, to pirated copies of the os? People dumb enough to install a pirated os diserve all the worms and viruses they can get! I have absolutely no sympathy for those people. | |
This is a simple example of how to delete a line from a text file. In order to do that you have to completely rewrite the file, leaving out the line(s) you want to delete. First open the input file, then open an output file (doesn't matter what filename you … | |
Re: >> A string can contain an '\0' before the actual end of the array Yes it can, but that makes it a binary string, not an ascii string, and most string functions in C and C++ will not be able to deal with it. | |
Re: excellent work. Only two suggestions: 1. fflush(stdin); -- fflush() is guarenteed to only work with output streams. Some compilers allow it for input streams, but that is compiler-specific and will not work on many compilers. 2. In the loop that gets keyboard input you should add a prompt to that … | |
Re: Here is a non-recursive version of the same. [code] #include <stdio.h> #include <string.h> char* _string_reverse( const char* src_string, char* dest_string ) { char *src_ptr = (char*)src_string + strlen(src_string)-1; char *dest_ptr = dest_string; while( src_ptr > src_string) { *dest_ptr++ = *src_ptr--; } *dest_ptr = 0; return dest_string; } int main() { … | |
Re: Here are some example how to use windows console api functions http://www.codexxi.com/MyBlocks.html#atConsoleObj | |
Re: the standard C library stat() is more portable to other operating systems. |
The End.