15,300 Posted Topics

Member Avatar for NinjaLink

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. …

Member Avatar for NinjaLink
0
273
Member Avatar for smco9

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.

Member Avatar for Ancient Dragon
0
226
Member Avatar for BozLopez1979
Member Avatar for snprime

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) …

Member Avatar for snprime
0
132
Member Avatar for Sweetrosie
Member Avatar for ivatanako
Member Avatar for Dukane

[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.

Member Avatar for Dani
0
121
Member Avatar for Nathan Campos

[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???

Member Avatar for marco93
0
130
Member Avatar for kz07

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 …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for redreed
Member Avatar for redreed
0
286
Member Avatar for redserpent7

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 ?

Member Avatar for redserpent7
0
163
Member Avatar for priyairani00

[URL="http://lmgtfy.com/?q=how+to+swap+two+variables+without+using+third+variable"]Link[/URL]

Member Avatar for priyairani00
0
90
Member Avatar for katwalatapan

>>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 …

Member Avatar for Ancient Dragon
0
138
Member Avatar for rice-_-
Member Avatar for Ancient Dragon
0
37
Member Avatar for Shuichon

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]

Member Avatar for Ancient Dragon
0
81
Member Avatar for Gonzobonkers

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.

Member Avatar for edhardy
0
25
Member Avatar for asphp

1) if you want a value between 0 and 9 then just use the mod operator [icode]int num = rand() % 10;[/icode]

Member Avatar for asphp
0
125
Member Avatar for wheel

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]

Member Avatar for wheel
0
187
Member Avatar for networkmancer

[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 …

Member Avatar for Ancient Dragon
0
241
Member Avatar for Moonbaby

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.

Member Avatar for Ancient Dragon
0
90
Member Avatar for networkmancer

>>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.

Member Avatar for Ancient Dragon
0
294
Member Avatar for basketball4567

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]

Member Avatar for jencas
0
118
Member Avatar for Dani

[QUOTE=cscgal;978277]Test thread. :)[/QUOTE] >>Test thread :) Please ignore #1 Ok, I will :)

Member Avatar for kaninelupus
0
41
Member Avatar for furqankhyraj

[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.

Member Avatar for Ancient Dragon
0
87
Member Avatar for AbsoluteCPP

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.

Member Avatar for Ancient Dragon
1
158
Member Avatar for azn_sweet

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.

Member Avatar for Aia
0
72
Member Avatar for bunnyboy

>>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 …

Member Avatar for bunnyboy
0
4K
Member Avatar for gretty

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.

Member Avatar for gretty
0
2K
Member Avatar for prashantsehgal

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.

Member Avatar for Ancient Dragon
0
71
Member Avatar for sknake
Member Avatar for shennon
Member Avatar for happygeek

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.

Member Avatar for Ancient Dragon
0
367
Member Avatar for slfisher

[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 …

Member Avatar for Ancient Dragon
0
554
Member Avatar for Brian.oco

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.

Member Avatar for Ancient Dragon
0
141
Member Avatar for happygeek

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.

Member Avatar for Ancient Dragon
0
410
Member Avatar for kc0arf

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 …

Member Avatar for blud
0
232
Member Avatar for kc0arf

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 …

Member Avatar for Libertate
0
261
Member Avatar for Danny

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 …

Member Avatar for Ancient Dragon
0
210
Member Avatar for Catweazle

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 …

Member Avatar for Ancient Dragon
0
244
Member Avatar for Danny

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)

Member Avatar for Danny
0
205
Member Avatar for kc0arf

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 …

Member Avatar for Ancient Dragon
0
180
Member Avatar for Catweazle

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 …

Member Avatar for Ancient Dragon
0
885
Member Avatar for Catweazle

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.

Member Avatar for Ancient Dragon
0
187
Member Avatar for Ancient Dragon

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 …

Member Avatar for majestic0110
0
11K
Member Avatar for eXceed69

>> 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.

Member Avatar for Ancient Dragon
0
134
Member Avatar for roverphoenix

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 …

Member Avatar for virusfree
0
151
Member Avatar for ~s.o.s~

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() { …

Member Avatar for roverphoenix
0
172
Member Avatar for Rajnesh
Member Avatar for eagleeye

Here are some example how to use windows console api functions http://www.codexxi.com/MyBlocks.html#atConsoleObj

Member Avatar for ankit_the_hawk
0
308
Member Avatar for BlackDice

the standard C library stat() is more portable to other operating systems.

Member Avatar for venomlash
0
122

The End.