15,300 Posted Topics

Member Avatar for richtowel
Member Avatar for MelechM
0
103
Member Avatar for jgalewsk

>>medalArray.country[i] That's the wrong way to access the array [icode]medalArray[i].country[/icode] BTW: you should rename that array to something else to prevent confusion (you and your prof) between the structure name and the array name.

Member Avatar for v1d1t
0
205
Member Avatar for architact

[URL="http://www.google.com/search?hl=en&q=differences+between+Object+Oriented+and+Structured+Programming.&btnG=Google+Search&aq=f&oq="]read these google links[/URL]

Member Avatar for Ancient Dragon
0
72
Member Avatar for skatamatic

The win32 api function you want is [URL="http://msdn.microsoft.com/en-us/library/ms724942.aspx"]SetSystemTime()[/URL]

Member Avatar for skatamatic
0
3K
Member Avatar for FTProtocol

The moderators are alive and well. The OPs post was just too damed funny to warrent deletion. I wanted everyone to share in his humor. Sounds like it might be a good start to a winning game.

Member Avatar for vmanes
-2
219
Member Avatar for ravenous

>>Are lists stored the same way, no. Lists are linked list and each node has its own memory location. >>But, I have also read that the memory that was previously used can only be filled with a vector that is small enough to fit in the old space. The old …

Member Avatar for ravenous
0
107
Member Avatar for kcpatron

>>turbo c? (c++ 6.0) What is that? Are you talking about two different compilers -- turbo C and VC++ 6.0 ? You can not use gotoxy() with VC++ 6.0 compiler.

Member Avatar for Ancient Dragon
0
111
Member Avatar for Spartan552

Why XML format? Look at these [URL="http://www.google.com/search?hl=en&q=memory+mapped+files&aq=f&oq="]memory mapped files[/URL] links

Member Avatar for ArkM
0
82
Member Avatar for grisha83

There is lots of information on the web that explains those things for you. [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=c%2B%2B+functions&spell=1"]Just search google[/URL]

Member Avatar for grisha83
0
149
Member Avatar for Diode

>> but what else can I do to put in CR and LF to the end of strings? simple [code] char str[100] = "a string"; // see Salem's post #2 for this line strcat(str, "\r\n"); [/code]

Member Avatar for Diode
0
2K
Member Avatar for sunveer

You first need to write a function that returns the factorial of a number. Be careful here because those values will grow very large very quickly. Calculating factorials in c++ programs has lots of limitations due to small numeric sizes. See limits.h for the maximum size of an integer or …

Member Avatar for ArkM
0
117
Member Avatar for leloo_d

You need to use the pointer [icode]cout << " " << it->time;[/icode] or like this: [icode]cout << " " << (*it).time;[/icode]

Member Avatar for leloo_d
0
91
Member Avatar for ivylim88

>>i need to include the last update date and time of the record in the form of dd-mm-yyyy,hh:mm:ss(it has to be updated by th program automatically) and i don't really know how. Just add another field called UpdateDateTime (or whatever you want to call it) to each record which would …

Member Avatar for ivylim88
0
147
Member Avatar for godlike111
Member Avatar for Ene Uran

blessing12 has already been banned by someone, so I doubt you will get any more of those PMs.

Member Avatar for Lardmeister
0
161
Member Avatar for NavenKumar

>>I almost completed the system You still have more clean-up work to do. 1) stop using [URL="http://www.gidnetwork.com/b-56.html"]gets()[/URL] and [URL="http://www.gidnetwork.com/b-57.html"]fflush(stdin).[/URL] . You are writing a c++ program, not a C program. So replace gets() with cin.getline(). And [URL="http://www.daniweb.com/forums/thread90228.html"]read this thread[/URL] how to flush the input stream. 2) Login problem. You need …

Member Avatar for NavenKumar
0
172
Member Avatar for winky

you must mean the number of digits in a number, You're program is almost right, except the while statement should check for t > 0, not t >= 10. That function doesn't need variable t at all, just use the parameter variable x.

Member Avatar for Narue
0
100
Member Avatar for rajesh37_p

google for ODBC. There are some free c++ classes that will help you. Do you know the SQL language? If not you need to google for that too.

Member Avatar for Ancient Dragon
0
34
Member Avatar for pogosecure

>>If there any function in C++ or C to resolve the problem Nope. The only way to get rid of characters is to completly rewrite the file, unless the characters happen to be at the end of the file.

Member Avatar for Ancient Dragon
0
29
Member Avatar for AutoC

getline() will get an entire line, including white spaces. [code] ifstream in("filename"); std::string line; int counter = 0; while( getline(in,line) ) { counter += line.length(); } [/code]

Member Avatar for Ancient Dragon
0
95
Member Avatar for hiraksarkardg

In MS-Windows and *nix operating systems a program can only write to memory that it ownes. The old MS-DOS days are gone forever, so writing to specific memory addresses as it was possible in MS-DOS 6.X and earlier is just no longer possible. And assembly would be of no value …

Member Avatar for Ancient Dragon
0
119
Member Avatar for draak13

>>fgets fails to work completely as advertised, Nope -- it has been working correctly for millions of programmers all over the world during the past 25 years. If there was a bug in fgets() then it would have been found and corrected years ago. The problem is in your program, …

Member Avatar for draak13
0
99
Member Avatar for bluesy

I can only give you a vague answer because of your vague question addContact: Information can only be added to the end of the file. How to do that depends on how the file is opened. [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html"]See the open flags here.[/URL]. My suggestion is to use the "a" flag so …

Member Avatar for Ancient Dragon
0
144
Member Avatar for amt_muk

It really depends on what you mean by zero-length string and how you want to use it. If its the source string in the functions you mentioned then yes, they can be safely used there. But if they are the destination string, then safety will depend on how the string …

Member Avatar for Ancient Dragon
0
126
Member Avatar for asifjavaid

Sorry to tell you that the only way to add something to the beginning of a file is to completly rewrite it.

Member Avatar for Ancient Dragon
0
115
Member Avatar for DegreasedMonkey

zip up the project and attached it to your post. I'll give it a try. Make sure you deleted all compiler-generated files first to make the zip file smalller.

Member Avatar for dougy83
0
107
Member Avatar for woody292

What part(s) of the assignment don't you know how to do? main() has two optional parameters -- argc and argv. [icode]int main(int argc, char* argv[])[/icode] argc is the number of parameters on the command line -- normally it is a minimum of 1, but on some embedded systems it could …

Member Avatar for VernonDozier
0
401
Member Avatar for phillipeharris

>>I dont know where I am going wrong. any help is cool The first error tells you what is wrong. You can't have two functions that differ only by their return type. Overloaded functions must have different parameters.

Member Avatar for Ancient Dragon
0
166
Member Avatar for ingvarorn

>>first of then strlen only counts the characters in the first word of the line I put into console The problem is your code, not strlen(). The >> operator stops accepting data from the keyboard when it encounters the first space or tab. All the rest of what you typed …

Member Avatar for ingvarorn
0
133
Member Avatar for /Shade Tree

It'd be nice to know what operating system you have and what kind of computer (or is it your mother-in-law you are talking about :) )

Member Avatar for starfireone
0
92
Member Avatar for bhoot_jb

IMO use MFC objects when available. In the two cases you cited it doesn't really matter to the compiler, it just makes your program more consistent if you use the MFC objects.

Member Avatar for bhoot_jb
0
164
Member Avatar for nizbit

worked ok for me, after I fixed the bug [code] int str_compare(const char *str1, const char *str2) { if (*str1 != '\0' || *str2 != '\0') { if (*str1 != *str2) { if (*str1 > *str2) { cout << "str1= " << str1 << " " << "str2= " << …

Member Avatar for ArkM
0
132
Member Avatar for Bigboy06

>>void main() [URL="http://www.gidnetwork.com/b-66.html"]read this[/URL] As for your problem: [code] int main() { int sum[256] = {0}; ifstream in("filename"); char ch; while( in.get(&ch) ) { if(ch > 0) ++sum[ch]; } // now just display all the rows in sum that are greater than 0 } [/code]

Member Avatar for ArkM
0
102
Member Avatar for JONZ

Yes, we can HELP you but we will not write it for you. You have to write the program then post questions about what you don't understand. I believe the first thing you need to do is design the contents of the data file. What data do you want to …

Member Avatar for JONZ
0
114
Member Avatar for daggath

how did you declare it in your vb program? what you posted appears to be correct. But you don't need both the *.def file and use of _dllspec(__export) -- all you need is one of them.

Member Avatar for daggath
0
171
Member Avatar for PalomoBlanco

They are just jealous *nix users because MS-Windows is soooooo much easier to learn and use.

Member Avatar for R0bb0b
0
203
Member Avatar for Ancient Dragon

I had to change computers because my other one bit the dust a couple days ago (64-bit Vista/IE7). Now when I log into DaniWeb I can't see the mod menus in Coffee House -- see thumbnail.

Member Avatar for Ancient Dragon
0
155
Member Avatar for BradenMurphy

I just compiled/linked with VC++ 2008 Express without a problem. What was the exact error message? What you quoted was only an indication that one or more errors occurred.

Member Avatar for BradenMurphy
0
332
Member Avatar for freelancelote

Because the pointer has not been initialized to anything. It just points to some random location in memory, which your program may, but probably does not, own. Before using a pointer you must initialize it to point somepace. For example: [code] int *pVar; int number; [color=red]pVar = &number;[/color] *pVar = …

Member Avatar for William Hemsworth
0
243
Member Avatar for Alex Edwards

flush is a function so you need to use () [icode]cout.flush()[/icode] Try this macro [icode]#define PRINT(x) (cout << x << "\n" )[/icode]

Member Avatar for Narue
0
3K
Member Avatar for Kadence

Did you try something like this? [code] #include <iostream> #include <string> #include <vector> #include <fstream> using namespace std; void foo(ifstream& in) { } int main() { vector<ifstream*> streams; for(size_t i = 0; i < 5; i++) { ifstream* in = new ifstream; streams.push_back(in); streams[i]->open("filename.txt"); } foo( *streams[1] ); } [/code]

Member Avatar for Kadence
0
820
Member Avatar for Jennifer84

This probably won't solve your problem, but ... Do you really need that vector? Why not just combine those two loops?

Member Avatar for Jennifer84
0
80
Member Avatar for chern4ever

The reason is because entering numbers leaves the '\n' (Enter key) in the keyboard buffer. cin.ignore() will just remove the '\n'. So you either need another cin.ignore() or do what you did and use cin.ignore(2)

Member Avatar for Nick Evan
0
93
Member Avatar for programmer321

>>Can Any one guide me for this. As a batch file, forget it. Can't be done. There is no way to send anything to an already running program from a batch file. But you can write a C or C++ program to do that and call that program from the …

Member Avatar for mittelgeek
0
1K
Member Avatar for tyserman5674

>> what would I name my file or doesn't it make any difference? It doesn't matter -- name it whatever you want. Text files normally have *.txt extension, not *.dat. >>So how do I have to call out this file in main? With ofstream its not necessary to specify ios::out …

Member Avatar for Ancient Dragon
0
96
Member Avatar for Ub3r Crippl3

The error message is pretty clear about what is wrong, and the solution sould be obvious: where did you declare MUSHROOM_END ???

Member Avatar for Ancient Dragon
0
109
Member Avatar for alajessie

[quote]The function top() returns a reference to the top element of the stack.[/quote] [url]http://www.cppreference.com/cppstack/top.html[/url] It does not return NULL, but returns a reference to the first object in the stack. Checking for NULL is not a valid thing to do.

Member Avatar for Salem
0
5K
Member Avatar for ambarisha.kn

how was the file opened? as text or binary? If binary then the next line character(s) depends on the operating system. In MS-Windows/MS-DOS you need "\r\n". *nix just "\n" and MAC "\r". If the file is opened in text mode then the operating system will make the appropriate translation of …

Member Avatar for ambarisha.kn
0
267
Member Avatar for dmanw100

I suppose you could use the time functions in time.h [code] time_t t1, t2; t1 = time(0); t2 = t1 while( (t2 - t1) < 1) // one second t2 = time(0); [/code] You might also check the [URL="http://www.boost.org/doc/libs/1_36_0/doc/html/date_time.html"]Boost time functions[/URL]

Member Avatar for Ancient Dragon
0
129
Member Avatar for namedrisk

Maybe [URL="http://www.codeproject.com/KB/dialog/Viewsinfullscreenmode.aspx"]this article[/URL] will help you.

Member Avatar for Ancient Dragon
0
73

The End.