15,300 Posted Topics

Member Avatar for mannantes

If you want to delete those lines from the file itself then you have to rewrite it. First open that file for reading, then open another temporary file for writing (name it anything you want except don't give it the same name as the original). After that, code a loop …

Member Avatar for mannantes
0
4K
Member Avatar for jamesny89

>>function takes 0 arguments What line number? Pay close attention to the parameters of the function prototypes at the top of the program and the parameters (or lack of parameters) passed in lines 44 thru 50 of your program.

Member Avatar for Salem
0
160
Member Avatar for joshmo

Without knowing the values of the variables its quite impossible to determine the solution to your problem. What compiler and os are you using? You need to learn how to use your compiler's debugger so that you can single-step through the program execution and see that the variable's values are.

Member Avatar for Salem
0
116
Member Avatar for WINPUSLIKR

The function should be declared to return [b]bool[/b]. If the value is even then return true otherwise return false.

Member Avatar for Ancient Dragon
0
57
Member Avatar for RohitSahni

program A calls program B. Program B writes some stuff to a file and program A reads it. Or you could use pipes (see man pages for [b]popen()[/b] )

Member Avatar for n.aggel
0
86
Member Avatar for niki01

Non-privileged mode operating systems are probably just too small to accommidate all the code needed to protect the hardware from damaging programs. For example MS-DOS 6.X and earlier were already limited to using 640K of memory, and that had to include the operating system and all TSRs, which left most …

Member Avatar for niki01
0
127
Member Avatar for The Dude

[quote]Mary Catherine Roper, a lawyer with the American Civil Liberties Union in Philadelphia, took issue with the citation. "You can't prosecute somebody for swearing at a cop or a toilet," she said [/quote] I think you can get ticketed for swearing at a cop, but when he is off-duty he …

Member Avatar for Ezzaral
0
96
Member Avatar for MiTiM

I did not get any errors with the code you posted. What compiler and os are you using? line 35: never ever use [b]gets()[/b] for anything because it can corrupt the memory of your program. If you type something that is longer than the destination buffer can hold, [b]gets()[/b] will …

Member Avatar for Salem
0
284
Member Avatar for RohitSahni

>> am not able to do that Yup -- you found out the hard way that it can't be done. One solution is to write the variables to a file or shared memory so that other programs can read them.

Member Avatar for Ancient Dragon
0
128
Member Avatar for addicted

>>will like someone to quickly give me a hint on how to use the mfc classes Ha Ha Ha. [URL="http://www.techtutorials.info/mfc.html"] Here are some tutorials[/URL] >>what i need to know. i wont mind how long it takes if you are willing to help Average learning curve is about one year.

Member Avatar for Ancient Dragon
0
103
Member Avatar for mrmonkee

Not possible to do it in pure C or c++ because the languages do not support cursor movement. You could do it in MS-DOS pretty easily with TurboC++ compiler. All modern MS-Windows compilers will require win32 api [URL="http://msdn2.microsoft.com/en-us/library/ms682073.aspx"]console functions[/URL]. For *nix I suppose you might have to use curses library …

Member Avatar for jbennet
0
2K
Member Avatar for Dave Sinkula

Interesting article about the Flat Earth Society. I'll bet they are also creationists who believe the earth is only 6,000 years old. Both turn a blind eye to scientific fact. As for 9/11 -- my bet is that Bugs Bunny and Daffy Duck were behind it. They probably hired the …

Member Avatar for jwenting
0
517
Member Avatar for eranga262154

even the fstream example you posted is not workable. line 4 does not calculate the size of a file but the number of TCHARs in the file, which might or might not be the same as the size depending on the UNICODE setting. As for CFile, the answer is NO …

Member Avatar for eranga262154
0
563
Member Avatar for Duki
Member Avatar for donaldunca

One huge problem is pointer [b]b[/b] only points to a one-byte empty string which can not be expanded. Since you want a string of 8 characters then you have to allocate memory for it something like this [icode]char b[9] = {0};[/icode]. That will allocate memory for 8 characters plus a …

Member Avatar for Ancient Dragon
0
108
Member Avatar for curt22

What kind of an object is ListViewTextItem? The second argument to fprintf() is a char*, not a c++ class. fprintf() doesn't know a thing about c++ or objects.

Member Avatar for Salem
0
95
Member Avatar for sandhyamanheri

My guess is that you need to add a constructor which initialized all the pointers to NULL. As it is those pointers are uninitialized and point to some random place in memory and any linked list using them will fail

Member Avatar for Duoas
0
127
Member Avatar for phalaris_trip

You mean remove it from CPlanet? or leave it there and instantiate another instance of it in main(). I assume the purpose of CAnimation is to make the class rotate on its axis, so removing it from CPlanet would not be a very good idea. If you instantiated an instance …

Member Avatar for phalaris_trip
0
120
Member Avatar for Massena

That's what happens when you jump the gun and dive right into the middle of a program. Its sort of like trying to fly a 747 jet airplain after about 4 hours flying time in a Cessna twin engine prop. You might learn to fly it after crash landing several …

Member Avatar for Massena
0
83
Member Avatar for meiyantao
Member Avatar for redaqen

>>fgets( str[y], sizeof str[y] / sizeof ( char ), stdin ); The division is unnecessary because sizeof(char) is guarenteed to always be 1. So it can be reduced to this: [icode]fgets( str[y], sizeof str[y], stdin );[/icode].

Member Avatar for Ancient Dragon
0
155
Member Avatar for skatamatic

[QUOTE=WaltP;462277]In other words, brute force. Outputting a bunch of newlines '\n' is the only portable way.[/QUOTE] And that isn't portable either because there is no standard way to determine how many line to clear.

Member Avatar for WaltP
0
2K
Member Avatar for Dave Sinkula

link is bad -- on Vista Home Premium I get unknown extension error (*.pl)

Member Avatar for twomers
0
128
Member Avatar for Azurea

Did you bother to read the [b]Read Me[/b] links at the top of this board? I thnk there are links to free compilers.

Member Avatar for ithelp
0
119
Member Avatar for Flakester

Enter the date using a std::string object [code] #include <string> ... int main() { std::string date; cin >> date; ... } [/code] now just use the isnumeric() macro to see if the digit is a digit or not. If a digit subtract '0' from the digit and add the int …

Member Avatar for WaltP
0
122
Member Avatar for jacknight

read the [b]Read Me[/b] threads at the top of this board because they have lots of information and suggestions.

Member Avatar for Ancient Dragon
0
99
Member Avatar for amishosh

You will want to create a file with *.c extension and VC will compile it as a c file, not c++. Create a new empty project. Then add a new file, when you give it a file name also specify the *.c extension -- such as myfile.c. How you do …

Member Avatar for iamthwee
0
182
Member Avatar for dasani

add a float counter and then add the value of [b]counter[/b] to it within the loop that begins on line 7 of the code you posted. >> but my code is all over the board. Looks ok to me, just add the code I mentioned above and you have the …

Member Avatar for Duoas
0
1K
Member Avatar for Dave Sinkula

I'm for legalization of marijuana but not other drugs. I have not read anything that indicates marijuana is any more harmful or adictive than alcohol and legalization for recreational use by persons over 21 does not seem to me to be unreasonable assuming the same limitations are placed on marijuana …

Member Avatar for scru
3
778
Member Avatar for ChaseVoid

[quote] think I'm gonna have a nervous breakdown during the presentation. Argh! I'm really not at all good at talking and especially in front of people. >_> doesn't make much sense huh! But I get nervous like hell, and stammer and then forget what I should say, and end up …

Member Avatar for Ptolemy
0
223
Member Avatar for jrice528

1. getScore() is supposed to return a double, but is actually returning a float. If you want it to return a double then declare [b]avg[/b] as a double. 2. The calculation is doing integer arithmetic because 3 is an integer. If you want it to do floating point then it …

Member Avatar for Ancient Dragon
1
131
Member Avatar for Duki

>>same problem Same problem as what?? I have no idea what you problem is. When starting a new thread do not make it dependent on a previous thread. If there is a problem then you need to describe what the problem is. To keep from repeating yourself you should not …

Member Avatar for Ancient Dragon
0
124
Member Avatar for muwaheedibrahim

Networking: [URL="http://en.wikipedia.org/wiki/Internet_socket"]google sockets[/URL]. There are hundreds of example programs on the net. One of them [URL="http://www.datareel.com/"]here[/URL] (it has lots of other stuff too that might interest you)

Member Avatar for Ancient Dragon
-2
31
Member Avatar for MidiMagic

[QUOTE=Salem;459238] For the older readership, dig out some of the videos of the late Bill Hicks, then try to justify your asymmetric position on the drugs issue.[/QUOTE] Never smoked pot, but when I was in college Speaking class of some sort during 1970s I started out to prove that pot …

Member Avatar for Ezzaral
0
389
Member Avatar for chizy2

you need to use the && operator, not || [code] while (choice != 'Q' && choice != 'q'); [/code]

Member Avatar for chizy2
0
143
Member Avatar for liphoso

>>i have no idea where to start Start here: [code] int main() { // your code goes here } [/code] You might research some of [URL="http://www.google.com/search?hl=en&q=c%2B%2B+polynomial+program&btnG=Google+Search"]these google links[/URL]

Member Avatar for Etniespr101
0
108
Member Avatar for rowly

I thik below is the correct implentation of that class. One problem with this implementation is that the class is attempting to manage a list of objects that it does not own, and if some other function decides to delete one of the objects it will invalidate the pointer in …

Member Avatar for summu
0
159
Member Avatar for Ryen_Lee

I suppose that [b]something[/b] is either Sleep() (MS-Windows) or sleep() (*nix) which will cause your program to get very little CPU time.

Member Avatar for Ancient Dragon
0
106
Member Avatar for iamthwee

I think its pretty funny. :) :) Some people just like to be silly and laughed at. You all are too prudish. Of course, on the flip side of that coin it means he will never be taken seriously on any of the sofware development boards.

Member Avatar for thunderstorm98
0
121
Member Avatar for mank

your examples are kind of screwy but I think I know what you want. There are two ways it could be done -- either as an array or a pointer to the data. The difference between the two is how you want to access the data in func2() -- use …

Member Avatar for mank
1
2K
Member Avatar for mqueene7

Instead of making 8 copies of that huge array I'd make just two, say array A and B. pass array A to a sort method, after sorted copy B to A and pass A to the second method. Do this for each sort algorithm. It'll save a whole lot of …

Member Avatar for Ancient Dragon
0
72
Member Avatar for dukedoc

[QUOTE=dukedoc;459329]Only problem is I can't use maps or any of that fancy jazz. [/QUOTE] [URL="http://www.cprogramming.com/tutorial/stl/stlmap.html"]tutorial[/URL]

Member Avatar for Salem
0
236
Member Avatar for majestic0110

First, the program you posted is a bastardization of C and C++ languages. As for your problem you need to flush the '\n' (Enter key) from the keyboard buffer after the sscanf(). There are several ways to do that but in C the easiest is to call getc() to remove …

Member Avatar for iamthwee
0
208
Member Avatar for perl21

>>Where do c++ developers obtain their libraries learn to use google. It would seem to me that you may have to write a device driver or program that hooks into the keyboard device driver because normally keyboard input is normally routed to the foreground window.

Member Avatar for Salem
0
94
Member Avatar for Ancient Dragon

[URL="http://www.youtube.com/watch?v=w3I1y3jHgxA"]This[/URL] has got to be among the world's best every written songs! Hope people will enjoy it for hundreds of years to come. :)

Member Avatar for Lardmeister
0
49
Member Avatar for maverick786

A more important question is: why is that [b]find[/b] method returning void? A find method normally locates an instance of something and returns the result to the calling function. If it didn't there would be no point to the function as it appears to be with your function.

Member Avatar for Ancient Dragon
-1
55
Member Avatar for crunchycrisp

line 36: filename needs to be defined a lot larger than that. If you are using MS-Windows operating system the max filename is 260 (or MAX_PATH if you include windows.h) >>how do i stop displaying text after question D) I suppose you mean that [b]do[/b] loop that starts on line …

Member Avatar for Aia
1
154
Member Avatar for Ancient Dragon

Any way to get just a quick list of just the thread titles so that the list doesn't cover so many pages of the cplusplus snippets (and others too)? Then if I see one that I might want to look at in more detail I could hover the mouse over …

Member Avatar for Ancient Dragon
1
62
Member Avatar for ecestd1

Learn to format your code better so that you can see what you're doing. Only takes a couple seconds to hit that space bar.

Member Avatar for ecestd1
0
1K
Member Avatar for sarwar

I don't use *nix but it sounds like a memory leak if there are only a few threads running at the same time. Could also be a limitation of the max number of open sockets at the same time.

Member Avatar for Salem
0
178

The End.