15,300 Posted Topics

Member Avatar for fire_

>>Am i doing it right? No. The code you posted will try to read the last line of the file twice. [code] ifstream in("inpufile.txt"); ofstream out("newfile.txt"); while( getline (in, str1) ) { out << str1 << '\n'; } [/code] >> And will this work on MFC project? Yes

Member Avatar for Ancient Dragon
0
275
Member Avatar for jeevsmyd

The C and C++ standards dictate how compilers do things. And the standards say that main() must return an integer value to the operating system. That always happens even in you decide to declare main() return void or even something else such as char*. One reason for that is to …

Member Avatar for Ancient Dragon
0
164
Member Avatar for Stefano Mtangoo

MSDN is free at [url]www.microsoft.com[/url] and can not be downloaded. If you need a local version you have to buy it for about a thousand $$$.

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for zandiago

Piracy is illegal. period. Its the same as stealing money from someone. If you have a job would you like it if someone else was paid for the hours that you worked ? >>On the other hand, those who practice/support piracy say that the original product is too expensive to …

Member Avatar for jon.kiparsky
2
982
Member Avatar for ^Y^ nobody ^Y^

I'm sure the OP will thank you for doing his homework for him, even though it's not 100% correct. But I'll give you a B+ for good effort.

Member Avatar for fire_
0
356
Member Avatar for corby

>>intset.cpp:16: error: prototype for âIntegerSet::IntegerSet(int*)â does not matc That means the constructor in the *.cpp file says the parameter is an int array, but in the *.h file it says the parameter is a single integer. >>main.cpp:36: error: invalid conversion from âint*â to âintâ Same problem as above. Fix the …

Member Avatar for Ancient Dragon
0
315
Member Avatar for darkmeyi0319

No. Turbo C is a C compiler, not c++. Get a modern c/c++ compiler such as Code::Blocks or VC++ 2010 Express, both are free.

Member Avatar for darkmeyi0319
0
145
Member Avatar for Ancient Dragon

I get a kick out of reading people's signatures and find many of them funny and witty. Which ones do you like? Here's one I just read :lol: [quote]If a job is 10% inspiration and 90% perspiration, does that mean the job stinks?[/quote]

Member Avatar for vegaseat
0
213
Member Avatar for techick

Find out what book your class will require, buy it and study it. Other than that, there are lots of good books, see the [URL="http://www.daniweb.com/forums/thread70096.html"]Stick thread[/URL] about c++ books.

Member Avatar for khusro.iqbal
0
112
Member Avatar for Neha Nandra1

you mean like [URL="http://lmgtfy.com/?q=calendar+c+program"]these?[/URL]

Member Avatar for Kieran Y5
-2
74
Member Avatar for daviddoria

you have to include <vector> in MyDerivedClass.cxx because its not included in any of the header files you created.

Member Avatar for daviddoria
0
263
Member Avatar for indigo.8

You will have to post some of the contents of the file before we can tell you how to convert it. If its somethng like this: [quote] 123 456 789 10 20 [/quote] You can use std::stringstream class to convert it from unsigned char* to an int array after its …

Member Avatar for indigo.8
0
5K
Member Avatar for PixelExchange

There doesn't appear to be an option to add that button. I just use Ctrl+F5 which is nearly as easy as that button. You will find lots of differences between those two compilers. That button is probably the least one to be concerned about.

Member Avatar for PixelExchange
0
111
Member Avatar for Bigbrain99

>>is this the right way to do append ofstream? No. Delete line 5 because line 4 opens the file in append mode. Its not writing to the file because of line 5.

Member Avatar for Bigbrain99
0
117
Member Avatar for embooglement

did you include <sstring> ? >>? ", " : " }\n"); Split that out into an if statement and see what the compiler says about it. [code] stream << matrix(x, y); if( x < 3 ) stream << ", "; else stream << " )\n"; [/code]

Member Avatar for embooglement
0
2K
Member Avatar for jaz854

see [URL="http://www.dotnet247.com/247reference/msgs/40/202700.aspx"]this thread[/URL] which is the first one listed in [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=Microsoft.Jet.OLEDB.4.0%27+provider&spell=1"]these google links.[/URL]

Member Avatar for JSS at MSSU
0
185
Member Avatar for calamaris

Change the language of your computer to something like Chinese where they read right to left.

Member Avatar for Ancient Dragon
0
38
Member Avatar for nocloud

That's called redirecting stdout to a file. Output to the screen is done with either stdout or stderr (in both C and C++). Another way to do it is for program 2 to create a pipe through which program 1's stdout is redirected through the pipe to program 2. [URL="http://docs.sun.com/app/docs/doc/816-5168/popen-3c?a=view"]Here …

Member Avatar for Ancient Dragon
0
92
Member Avatar for harikrishna439

You can't really delete an element. All you can do is move the data in higher subscripts to lower ones. For example if you have an array of 10 elements and you want to delete the 2nd one you have to move elements 3 to 10 to elements 2 to …

Member Avatar for Ancient Dragon
0
178
Member Avatar for pdk123

typecasting is always error prone. >>blindly typecasting will result to problems ? "may" cause problems, not will. That's when you have to know what your doing, and even that is no guarentee that a typecast will be correct.

Member Avatar for mike_2000_17
0
162
Member Avatar for mrsahil30

A little pseudocode [code] beginning of loop display "Enter your password\n"; get user keyboard input if password is correct then exit this loop if this is the third attempt then exit this program, end of loop [/code]

Member Avatar for Nick Evan
-4
197
Member Avatar for michdd

The class destructor is responsible for deallocating memory for those pointers, assuming the memory was allocated using new or malloc().

Member Avatar for mrnutty
0
85
Member Avatar for darkangel07

First figure out how to solve it on paper, then write a program to do it similar way.

Member Avatar for tesuji
0
151
Member Avatar for Hektzu

>>tmp += 2; The first one doesn't work because the program keeps changing the value of temp on every loop iteration. Delete that line and the program will work.

Member Avatar for Hektzu
0
107
Member Avatar for Dazaa

use a vector [code] vector<Point> points; Point p; while( inFile >> p.x >> p.y ) { points.push_back(p); } [/code]

Member Avatar for mike_2000_17
0
144
Member Avatar for watery87

When a line of text is read from the file check to see if it contains "fr_name". If it does, then extract the name and put it into the vector. [icode]std::vector<std::string> friends;[/icode]

Member Avatar for watery87
0
79
Member Avatar for mhelal

getline() in the posted example is probably his own C function because the parameters are incorrect for the c++ version. May I suggest you look in semaphore.h and see if there is a marco you need to define.

Member Avatar for swatithakur
0
214
Member Avatar for King_Alucard

line 66 of the code you posted: variable size has not been declared line 77: what is [b]Start[/b] ? line 78: you need to use == boolean operator, not = assignment operator

Member Avatar for VernonDozier
0
463
Member Avatar for denguru4

Post code. We are not clarvoyant and I don't have my crystal ball with me.

Member Avatar for denguru4
0
71
Member Avatar for indr

What compiler are you using? Your program compiles without error using vc++ 2010 express. And this is the output [quote]3.1400Press any key to continue . . .[/quote] Note that if you want a line feed before Press then you need to add '\n' to the cout statement.

Member Avatar for Ancient Dragon
0
184
Member Avatar for Bordeaux0113

>>Does anybody know how I could do this? Yes -- write a probram using VB.NET. If you want a more complete answer you will have to post your question in one of the software support forums, not here in Geek's Lounge.

Member Avatar for Ancient Dragon
-1
138
Member Avatar for camcam08

You mean you want to call notepad.exe from your *.cpp program? Then use system() or ShellExecute().

Member Avatar for helpme87
0
202
Member Avatar for plizz

>>So why we can overcome this and create class definition in more than one file? Put the class declaration in a header file with *.h extension and include the header file in all *.cpp files that use it. The implementation code goes only in one *.cpp file. >>Summarize: why it …

Member Avatar for mike_2000_17
0
277
Member Avatar for Interrupt

No. Windows Forms require c++, not C. If your embedded device is running some version of MS-Windows then you might be able to use pure win32 api functions. But if its running *nix then I don't know.

Member Avatar for $urya
0
3K
Member Avatar for server_crash

I don't see US currency ever merging with Canada's either -- Canada probably doesn't want it because US currency is going the way of Mexico's -- worthless.

Member Avatar for vegaseat
0
220
Member Avatar for lilfish08

what are a few of the error messages? What compiler and operating system are you using? It looks like you are attempting to compile pseudo code that your teacher gave you as if it is c/c++ code. You can't do that. You have to translate that pseudocode into c++ code …

Member Avatar for lilfish08
0
209
Member Avatar for Bordeaux0113
Member Avatar for Astro2010

If the file contains only numbers why are you reading them as strings? [code] float number; while( fsprintf(fp,"%f", &number) > 0) { // do something with number } [/code]

Member Avatar for Ancient Dragon
0
91
Member Avatar for saransh60

>> strcat(s1,s); //giving error while copmiling You can't use strcat on s1 because s1 is std::string. All you need is [icode]s1 += s;[/icode]

Member Avatar for Ancient Dragon
0
169
Member Avatar for miskeen
Member Avatar for saransh60

line 51: close() does not clear the end-of-file flag. After calling close() call clear() so that indata can be used for subsequent loop iterations. Another way to do it is to move line 18 down so that its inside the loop (line 25).

Member Avatar for saransh60
0
199
Member Avatar for iceman29

[QUOTE=iceman29;889279]I am working on UNIX, and using CC to compile the code.[/QUOTE] Wouldn't it be terminal dependent? something to do with termcap settings? (Just guessing, its been 15 or so years since I worked with *nix).

Member Avatar for xavier666
0
204
Member Avatar for Panarchy

>>Only using libraries built into Dev-C++ That is a very old and obsolete IDE/compiler. Download Co[URL="http://www.codeblocks.org/"]de::Blocks[/URL] and current MinGW compiler. I'm assuming you are talking about MS-Windows operating system. Then read [URL="http://winprog.org/tutorial/"]this tutorial[/URL] to get you started with GUI. By the time you finish the tutorial you will probably realize …

Member Avatar for Ancient Dragon
0
103
Member Avatar for server_crash

your compiler is correct. print() is not accessible outside Bird class because of private inherentence. It can only be called from within Bird class just like any other private member.

Member Avatar for brkurre
0
220
Member Avatar for glamourhits

line 12: for (i=1; i<=N; i++) Array elements always begin with 0, not with 1. So when that loop reaches N the value of i will be beyond the range of the arrays. The loop should be coded like this: [icode]for( i = 0; i < N; i++)[/icode] >>the program …

Member Avatar for Anyzen
0
181
Member Avatar for rinoa0424

>>Can anyone give me some tips?? Lots of practice. Learn everything you can about hardware and operating systems.

Member Avatar for Narue
0
218
Member Avatar for nsd11

When you downloaded Code::Blocks did you get the version that contains MinGW compiler?

Member Avatar for nsd11
0
491
Member Avatar for PixelExchange

Very similar to the way you would do it with printf(), but use sprintf() to format the string in a character array, then send the character array to MessageBox() or whatever win32 api function you want. Note that if your program is compiled for UNICODE then you will have to …

Member Avatar for PixelExchange
0
201
Member Avatar for Stefano Mtangoo
Member Avatar for jrdark13

>> I don't have the time or requirements to download and install everything for Windows CE. It would be greatly appreciated. Nonsense. You have the time to post a requrest here and wait several hours for someone to hopefully give you the *.cpp file. You could have downloaded the entire …

Member Avatar for Ancient Dragon
0
87

The End.