15,300 Posted Topics
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: LOL: Very similar to the one about [URL="http://www.wanderings.net/notebook/Main/UpgradingFromGirlfriendToWife"]upgrading from girlfriend to wife[/URL]. | |
Re: >>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; … | |
Re: 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. | |
Re: People's real names are also google searchable. google your real name and you may also get some hits. | |
Re: >>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 … | |
Re: 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. | |
Re: 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 … | |
Re: >>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. | |
Re: 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 … | |
Re: You can display leading 0s like this (include <iomanip> header file [icode]cout << std::setfill('0') << std::setw(6) << b << '\n';[/icode] | |
Re: Is there a question somewhere? Or do you just like posting code? | |
Re: The last post in that thread told you how to write to the file without first deleting its contents. | |
Re: 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. | |
Re: 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] | |
Re: Mike: it took you over 33 minutes to press the Post Reply button?? | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: >>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 … | |
Re: [URL="http://msdn.microsoft.com/en-US/library/kt26tkzx.aspx"]Did you read this[/URL] (and the example at that link)? | |
Re: 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 … | |
Re: [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 … | |
Re: [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 … | |
Re: 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 … | |
Re: >>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 … | |
Re: 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 … | |
Re: Your program needs to link with Ole32.lib. Check the project setting of your compiler to see that it is doing that. | |
Re: 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 … | |
Re: 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 … | |
Re: use a register for destination [code] mov ax,0 mov di,03c8H mov word ptr [di],ax [/code] | |
Re: You have to write a GUI program. For MS-Windows [URL="http://winprog.org/tutorial/"]here is a tutorial[/URL] | |
Re: Might be a permissions problem. Does your program check the success of opening the files, such as with stream.is_open() ? | |
Re: What operating system? MS-Windows you can call ShellExecute() or CreateProcess(). system() can also be used but it is not recommended. | |
Re: 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. | |
Re: 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 … | |
Re: 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] | |
Re: 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] | |
![]() | Re: >>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 … |
Re: 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] | |
Re: Yes. Memory allocated with new must be released with delete or delete[]. That's because delete calls the destructor while free() does not. | |
Re: maybe use [URL="http://www.cplusplus.com/reference/algorithm/random_shuffle/"]std::random_shuffle()[/URL] | |
Re: 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] | |
Re: 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() | |
Re: 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] |
The End.