15,300 Posted Topics

Member Avatar for paramveer

try any one of [URL="http://www.google.com/search?hl=en&lr=&q=how+to+read+xml+file+with+c+program&btnG=Search"]these[/URL], but be prepared to learn lots of COM stuff. This is one case I recommend doing it in VB.

Member Avatar for giskumar
0
3K
Member Avatar for HeartBalloon

line 40 is wrong -- as posted it is just a simple global function, which is unrelated to the Tree class. You need to add Treed:: before the function name, similar to what you did on line 29.

Member Avatar for HeartBalloon
0
998
Member Avatar for Catweazle

I have latest Firefox 3.0.1 that I installed just a couple days ago and IE7, but I don't see much difference speedwise. They are both about the same on my computer.

Member Avatar for Rik_
4
2K
Member Avatar for FL Botanist

1. Yes 2, 3, and 4 -- I don't know 5. With a compiler. For MS-Windows you have several choices, such as Code::Blocks and VC++ 2010. For *nix normally compile with gcc, which is on most *nix computers. C programs have to be compiled for the operating system in which …

Member Avatar for FL Botanist
0
251
Member Avatar for AndreRet

LOL: Very similar to the one about [URL="http://www.wanderings.net/notebook/Main/UpgradingFromGirlfriendToWife"]upgrading from girlfriend to wife[/URL].

Member Avatar for bumsfeld
2
192
Member Avatar for vidit_X

>>We can not use a double pointer(int **) for a two dimensional array, right Wrong. Here is a brief example of how to allocate such a thing. [code] int main() { const int numRows = 5; const int numColumns = 10; double** pointer = new double*[numRows]; for(int i = 0; …

Member Avatar for vidit_X
0
178
Member Avatar for justinclev

I'm using Windows 7 and I can't make GetOpenFileDlg() to work. Maybe its deprecated because Microsoft recommends using [URL="http://msdn.microsoft.com/en-us/library/bb776913%28VS.85%29.aspx"]IFileOpenDialog[/URL] now. But I'm certain that GetOpenFileDlg() is still support otherwise no program written before Vista would work on Vista or Win7.

Member Avatar for Ancient Dragon
0
3K
Member Avatar for snkiz

People's real names are also google searchable. google your real name and you may also get some hits.

Member Avatar for ~s.o.s~
0
461
Member Avatar for barevhayerable

>>that bool takes only one bit -> but how am I going to make char from one bit No, the bool data type takes a whole byte (or possibly int) because a byte is the smallest addressable object. If you are unsure about the size of something you can easily …

Member Avatar for Ancient Dragon
0
201
Member Avatar for pseudorandom21

I don't see why that would not be possible, text is just a graphic like lines. There most likely are not any free tutorials that will show you how to do it. I would start out [URL="http://msdn.microsoft.com/en-us/library/a36fascx.aspx"]here[/URL] and write some small programs that illustrate the concepts to myself.

Member Avatar for pseudorandom21
0
146
Member Avatar for jshoot

line 13: variable str was declared on line 3 to have only 3 characters, yet you expect someone to type up to 256???? Also, use cin.getline(), not cin.get() because getline() will allow you to enter spaces. The syntax in the loop is incorrect. ifstrezam will make all conversions for you …

Member Avatar for jshoot
0
609
Member Avatar for katisss

>>i am taking a class and have been asked to explain why this is bad Beats me. If you find out please post the reason so we can all learn something.

Member Avatar for katisss
0
81
Member Avatar for chamika.deshan

The example you posted probably works because child class has no data members, just one method. When you allocate a class with new the compiler only allocates data because the methods are already in memory. If you add some data members to child class I'll bet the program won't work …

Member Avatar for mike_2000_17
0
140
Member Avatar for gregarion

You can display leading 0s like this (include <iomanip> header file [icode]cout << std::setfill('0') << std::setw(6) << b << '\n';[/icode]

Member Avatar for deltamaster
0
527
Member Avatar for Paritosh Das
Member Avatar for Adak
-1
145
Member Avatar for mmmerlin

The last post in that thread told you how to write to the file without first deleting its contents.

Member Avatar for mmmerlin
0
518
Member Avatar for alex55

add another variable to keep track of the element number and use it just like you do highTemp variable that appears on line 6 of the code you posted.

Member Avatar for alex55
0
131
Member Avatar for Dexxta27

lines 8, 9 and 10 must be inside a function [code] #include <string.h> typedef struct electro { char name[20]; int access_number; char address[50]; float balance_due; }; int main() { electro account[10]; account[0].balance_due=120.52; strcpy(account[0].address, "Cane Gardens"); } [/code]

Member Avatar for Dexxta27
0
214
Member Avatar for QuesoTaco
Member Avatar for QuesoTaco
0
340
Member Avatar for tomtetlaw

compilers will leave holes in the structure if its data members are not aligned properly. One reason for adding padding members is to insure the structure compiles the same with every compiler and operating system and to make transmission across tcp/ip more reliable.

Member Avatar for Ancient Dragon
0
84
Member Avatar for Pranilchamp

One of the purposes of MBA is to prepare you for supervisory roles, such as department head. MBA is not directly related to IT. You should take a look at your school's course requirements.

Member Avatar for Ancient Dragon
0
14
Member Avatar for prahesh

When VISA is installed it most likely will add a registry entry in HKEY_CURRENT_USER\Software. Use regedit.exe on a computer that has it installed to verify the registry key. Then visually searth the entries in that key to find out if it has the install location. If not, then you are …

Member Avatar for Ancient Dragon
0
192
Member Avatar for jackmaverick1

The most common reason for that error is including the same header file more thn once in the same *.c or *.cpp file. To prevent the problem you need to add code guards in the header file [code] #ifndef MYHEADER_H #include MYHEADER_H // declare class and other stuff here #endif …

Member Avatar for Fbody
0
8K
Member Avatar for Lelly

The instructions are not clear enough. Do you have to generate two files that contain random numbers, such use a merge-sort altorithm to merge them into one sorted file? Or generate one large file, split it into two smaller files, then use merge-sort ? You should start by reviewing [URL="http://lmgtfy.com/?q=merge-sort+c%2B%2B"]these …

Member Avatar for Lelly
-1
2K
Member Avatar for sheennave

>>Is this a SQLite bug ?? No -- it is a bug in your program. >>VALUES ('greyfurt', '"+Weight+"' , '"+arraySource_energy_kcal[0]+"' ) "; Do not put quotes around the floats -- the quotes are only for the strings. You will have to format the query before sending it to SqLite, something …

Member Avatar for sheennave
0
294
Member Avatar for l1nuxuser

[URL="http://msdn.microsoft.com/en-US/library/kt26tkzx.aspx"]Did you read this[/URL] (and the example at that link)?

Member Avatar for l1nuxuser
0
252
Member Avatar for rmlopes

depends on the thread, but many times execution time is not measurable because it happens too quickly. But generally you would call time functions when the thread starts and again when it ends, then execution time is the difference between those two times. Call clock() to get time in milliseconds …

Member Avatar for JohnDiego
0
5K
Member Avatar for Jcastillo2010

[icode] int main(void) { [/icode] When I was working on *nix and using vi I used to write code like that too, because vi can easily find any function by seaching for "^main". That's especially useful in long programs. But that was many many years ago, and IDEs have become …

Member Avatar for Trentacle
0
172
Member Avatar for indrajeet6

[quote] 1>------ Build started: Project: test1, Configuration: Debug Win32 ------ 1> test1.cpp 1>c:\dvlp\unmanaged\test1\test1.cpp(2): fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/quote] Notice the second line tells you what's wrong. Then if you removed …

Member Avatar for indrajeet6
0
449
Member Avatar for sneekula

Humanity will become extinct with the next nuclear war. Nuclear war is much more likely to happen in our lifetimes than a nasty metor or solar flare. An interesting film on the History Channel this morning speculating about why the dinosaurs became extincet some 65 million years ago. Current scientific …

Member Avatar for bumsfeld
2
935
Member Avatar for JordanHam

>>I have a book here "Microsoft Visual C++.net" with all the installation and whatnot with it. It doesnt use the normal cin and cout but used Console::WriteLine and what not. Because that is not c++ -- its a different language called clr/c++, which is a derivative of c++. If you …

Member Avatar for JordanHam
0
133
Member Avatar for KushMishra

You probably got no responses because no one knows what the hell you are talking about. Don't assume everyone knows what those acronyms mean, such as KPO, "HCL BPO" and "B.Tech. in Computer Science". You should also mention what country you live in. This is the net and for all …

Member Avatar for KushMishra
1
559
Member Avatar for remuladgryta

Your program needs to link with Ole32.lib. Check the project setting of your compiler to see that it is doing that.

Member Avatar for DJRoss
0
3K
Member Avatar for kamotekid08

The first step is to create a structure or class for the record. After that you can determine the file format. Finally, write each of the functions that add, insert, modify and delete records. Write and test these just one function at a time so that you don't get overwhelmed …

Member Avatar for jonsca
0
3K
Member Avatar for david09436

line 45 and 48: a, b, c, d and e are structures and you can not compare structures like that (unless you code in some operator overloads which I don't think you are ready to do yet). In the student structure which of the several double values are you trying …

Member Avatar for Red Goose
-3
150
Member Avatar for ThatGuy2244
Member Avatar for ThatGuy2244
0
807
Member Avatar for ben25x

You have to write a GUI program. For MS-Windows [URL="http://winprog.org/tutorial/"]here is a tutorial[/URL]

Member Avatar for Ancient Dragon
0
2K
Member Avatar for MasterGberry

Might be a permissions problem. Does your program check the success of opening the files, such as with stream.is_open() ?

Member Avatar for MasterGberry
0
281
Member Avatar for abdullah0

What operating system? MS-Windows you can call ShellExecute() or CreateProcess(). system() can also be used but it is not recommended.

Member Avatar for Ancient Dragon
0
25
Member Avatar for bussa.forums

You should [URL="http://www.fox-toolkit.org/"]join their mailing lists[/URL] to get specific and timely answers to your questions about that toolkit.

Member Avatar for Ancient Dragon
0
43
Member Avatar for Luke11

Writing a 32-bit program in assembly language is a very difficult task. Just converting the c code to assembly is not enough because there is a lot of work that the program does before main() is ever called, such as switching the computer from real to protected mode, building the …

Member Avatar for Ancient Dragon
0
66
Member Avatar for kohoko

rand() will return a random number. If you want to restrict it to a set of numbers between 0 and N than use the mod % operator, such as [icode]int x = rand() % N;[/icode]

Member Avatar for kohoko
0
199
Member Avatar for jnick12

If statements are better than switch in this case because switch can not be used with ranges of values. For exxample you can not say [icode]case numAvg < 60[/icode]

Member Avatar for alaa sam
0
5K
Member Avatar for Chris11246

>>and if I try snake++ it doesnt work Because snake is not a pointer -- its a 2d array. If you want to move the data from snake[1] to snake[0] you have to move all three integers in each row. >>What am I doing wrong? We don't know because you …

Member Avatar for Ancient Dragon
0
96
Member Avatar for mespo365

Another approach is to use stringstream class [code] #include <string> #include <sstream> #include <iostream> int main() { std::string s = "123"; int x; std::stringstream str(s); str >> x; std::cout << x << '\n'; std::cin.get(); } [/code]

Member Avatar for jonsca
0
173
Member Avatar for LevyDee

Yes. Memory allocated with new must be released with delete or delete[]. That's because delete calls the destructor while free() does not.

Member Avatar for nndung179
0
231
Member Avatar for MasterGberry

maybe use [URL="http://www.cplusplus.com/reference/algorithm/random_shuffle/"]std::random_shuffle()[/URL]

Member Avatar for MasterGberry
0
1K
Member Avatar for beejay321

you have to tell the compiler that ifstream and ofstream are in std namespace. There are a couple ways to do that [code] #include <fstream> using std::ifstream; using std::ofstream; [/code] or this [code] #inclue <fstream> #include <iomanip> int main() { std::ifstream fin; std::ofstream fout; } [/code]

Member Avatar for beejay321
0
335
Member Avatar for kra9853

rand() returns integers, not doubles or floats, so you might as well declare setNum as an array of integers. And the code you posted does not even reference that array nor does it ever call rand()

Member Avatar for Ancient Dragon
0
145
Member Avatar for ElegantElephant

When you want to declare an array of the same size as a const string literal then don't specify the array size so that the compiler can figure out the size itself [icode]char string[] = "184553";[/icode]

Member Avatar for Ancient Dragon
0
8K

The End.