1,426 Posted Topics
Re: [Here](http://lmgtfy.com/?q=working+with+docx+files+in+c%2B%2B) you go. | |
Re: arrySize = 1; for(int i = 0; !scorFil.eof(); i++ && arrySize++)//for loop for the readable file, collect the scores { //the array size is incremented as well scorFil >> score; arry[i] = score; } Becomes arrySize = 0; int i = 0; while(scorFil >> score) { arry[i++] = score; arrySize++; … | |
Re: Try making `if(index>=childcontrolsindex)` `if(index>childcontrolsindex)`? | |
Re: Without running your code the one thing that sticks out to me is for (forwardTIterator=theRef.cbegin(), backwardTIterator=(theRef.crbegin()+1); forwardTIterator!=theRef.cend(); forwardTIterator++,backwardTIterator++) Why are you using `backwardTIterator=(theRef.crbegin()+1)`? Shouldn't it be `backwardTIterator= theRef.crbegin()` since `crbegin()` points to the last element of the container. [Here](http://www.cplusplus.com/reference/vector/vector/crbegin/) is a good link for `crbegin()`. It is for vectors but … | |
Re: That's not a question. What is your question? We only give homework kelp to those that show effort. | |
Re: What is the code that you have and what is the error the compiler is giving you? | |
Re: Well if you assume that no name has a number in it then to find the social in the line you would do `size_t spot = line.find_first_of("0123456789")`. Once you have that you can erase the social from the string and then insert into it `"XXX-XX-XXXX"`. After that you would have … | |
Re: Well you are calling `getline` and `get` so you need to hit enter twice. What is the purpose of using `cin.get()` in your if statement? getline will toss it out so there would be nothing there. | |
Re: What do you have so far? We only give homework help to those that show effort. | |
Re: Make the access for all of the class members public in the nested class and declare the nested class in the private part of the main class. this way you can access the members directly but only from within a function of the main class. If you don't want the … | |
Re: With arrays I am in favor of having the caller suppling the 1d array to the function. That way the caller knows they are responsible for the array. It's a shame that dont just start of with using the STL and after they are comfortable with it teach them how … | |
Re: You need another class. You should have a school class that has a vector of classrooms. The classroom class should hold on to what floor and room number it is. It should also have a vector of students that will hold all of the students that are in that classroom. | |
Re: change line 18 `HardwareRecord(int=0,std::string="",std::string="",double=0.);` to `HardwareRecord(int account=0,string name="",string description="", double price=0.0);`. That should fix it. | |
Re: cout<<" Inode number: "<< sb.st_ino; You only need the long if you want it explicitly cast to a long. If you do want to cast and you want the code to be c++ then you could do this: cout<<" Inode number: "<< static_cast<long>(sb.st_ino); | |
Re: You can use `cout` to debug. Just output parts that are questionable or you are not sure what the value is. You don't need to actually step through a debugger to debug code. | |
Re: What is the error you are getting? | |
![]() | Re: I would take a look at [this](http://www.mono-project.com/Main_Page). I have reads some review though that call this a second class citizen compared to MS C# |
Re: if (!(assignment == complete)) if (today > dueDate) return failure; else output << "Get working on your code. We only give help to those that show effort and code!!" | |
| |
Re: I have a questions for you. Why does `Players` have a size of 1000 when you only need 128?. If you post the full code I can step through it with my debugger and see what is going on. | |
Re: I would read in the entire line and then break it up. string line; int total = 0; ifstream fin("file.txt"); while (getline(fin, line)) // get the line { // loop by three for (size_t i = 0; i < line.size() i += 3) total += atoi(line.substr(i, 3).c_str()); // get the … | |
Re: there is a feature in vista that will use a usb jump drive as a sort of ram but this is very slow. maybe a better way would to use an esata connection to some flash based memory. just a thought | |
Re: Change while(std::getline(fin,line)) { for(i=0;i<line.length();i++) { line.substr(0,'32'); } cout<<line<<endl; } To while(std::getline(fin,line)) cout << line.substr(0, line.find_first_of(" ", 0)) << endl | |
Re: `ifstream in("TEST.dat");` on lines 49 and 70 needs to be just one decleration done before the switch statement. | |
Re: Hate to burst your bubble but according to your guidelines you are to late to submitt this. What kind of idea do you need to start this? The sheet gave you three references you could use as a basis for your project. | |
Re: Given SPLINKS contains: 1 3 4 abcmap contains; 1=> 1 2=> 2 6 3=> 1 2 4 What should the results be when the operation is finished? Maybe this? SPLINKS contains: 1 4 abcmap contains; 1=> 1 2=> 3=> 1 4 | |
Re: No. We dont just give code. show us what code you have and what is wron with it and we can help you with that. ![]() | |
Re: What do you have so far? Do you know what a pointer is? We only help people that show effort. If you dont show your code you dont get code. | |
Re: If you are going a comparision which i think you are since you are returning a bool you need to change this: bool operator=( const PCB& other ) { return other.getTau() = this->getTau(); } To bool operator ==( const PCB& other ) { return other.getTau() == this->getTau(); } | |
Re: I would think you should be able to do this. I have not tested this. // main always returns an int so dont forget to change this int main() { std::stringstream ss; std::string line; std::fstream fin("somefile.txt"); std::vector<int> numbers; // read each line from the file while(std::getline(fin, line) { std::string temp; … | |
Re: They are for getting input and pushing out output. cin is a input stream object and if you use `cin >> someVariable` you can think of it as from cin put value into someVariable. cout is a output stream and when you write `cout << someVariable` you can think of … | |
![]() | |
Re: What have you done so far? What part of the problem dont you understand? You have to put in an effort if you want help. | |
Re: If all you want to do is to change the zeros in a column to 99 if all of he arrays have a zero in that column then you can do the following. this is psudeo code so it wont compile. for i = 0 until i < arraysize { … ![]() | |
Re: if you have a compiler that support c++11 check [this](http://www.cplusplus.com/reference/chrono/high_resolution_clock/now/) out. It will show you how to use the high resolution clock available in c++11. | |
Re: Well you have a couple ways to approach this. If all of the forms connect back to a central server then the server can hold on to the reference number and everytime a new form is open it would increment the number by one. This way every form has a … | |
Re: You need a destructor for `MyCon` that frees the memory. Something like this should work. ~MyCon() { delete [] matA delete [] matB } | |
Re: What is your definition of a digit? A number is a digit or is made of digits so I'm not sure what you are talking about. | |
Re: If you want the time of the run of the inner loop for every iteration of the out loop you should be able to do this //... std::vector<std::pair<clock_t, clock_t>> loopTimes for (int i = 0; i < N; i++) { cloct_t begin = clock(); for (int j = 0; j … | |
Re: Download the file called "ekiga-4.0.1.tar.xz". It is a tarball compressed with xz looseless file compression. in windows you can open it with 7-zip. | |
Re: MSVC++ is mostly standard compliant. I say mostly because it doesnt have all of the C++11 features. It's C++98/03 compliance is pretty good. | |
Re: What part of the code dont you understand? Did you write this code? You should also look into indenting your code properly. The way you have it now makes it very hard to read. If I wrote this code it would look like this: #include <iostream> using namespace std; int … | |
Re: Did you already ask this [here](http://www.daniweb.com/software-development/cpp/threads/477478/why-us-c-better-for-system-programming-than-java)? Schol-R-LEA and mike_2000_17 did a really go job explaining in that post. | |
Re: On line 32 you have `value = amp*sin(2*pi*freq*t)`. `value` is a `float *` so assigning `amp*sin(2*pi*freq*t)` to value makes no sense because `value` is a pointer which is an integer number. Now if you want to store the return into the `float` that `value` points to you need to do … | |
Re: So what part are you having a problem with? We will not do your homework for you. Just posting the assignment without anything else is not the way things work on this site. | |
Re: Yes Java is multi-platform but that can misleading as well. Different java runtimes can produce different behavior. If you use something from a newer version of Java it might not work on some machines running an older runtime. I ran into this in my Java class. | |
Re: You would need some sort of arbitrary precision library. [The GNU MP Bignum Library](https://gmplib.org/) is pretty good. | |
Re: Nevermind. Deceptikon you beat me to it. I will say that you can make this work for sentences with more then 3 words using stringstreams and a vector. |
The End.