- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
53 Posted Topics
Re: Do you have any experience with XSLT? Since SOAP messages are actually XML documents, you can transform them with the XSLT language. Your biggest concerns seem to be renaming elements and injecting the character data into new elements. Keywords for XSL functions are xsl:template, xsl:match and xsl:apply-templates Try searching for … | |
Re: Your friend is correct. Carefully read his instructions. > create a function that takes two employee objects by reference and returns a bool `bool lessThan( Records& a, Records& b );` > function is one if else statement where you check whether the first parameter name is less than the second … | |
Re: Please re-implement the backend for the Member badges. If possible, use the same URLs you used to. People are forced to edit their site HTML since the backends are gone... | |
Re: This does not sound like a good way to implement a form :) Anyhow, you can attach your submit button to a javascript function, in which you can make a customized POST call with ajax function submitForm() { //select the text value with native js or jquery var text = … | |
Re: Implement a function which iterates over the 7 digit phone number (one digit at a time) and checks if it's the same as the digit before. I suggest converting the phonenumber to string for easier manipulation. Here's a short example (not the complete solution;) [CODE] bool hasDoubleDigits( int phoneNumber ) … | |
Re: Your .h file and .cpp file must match each other. You're implementing the constructor just about fine (in .cpp file) but are missing the declaration for that constructor. Declare these ( in .h file) [code=c] TimeOff(); // this is the default constructor TimeOff(string n, int empid, double maxSick, double sTaken, … | |
Re: -You are setting the value of rev to one character at a time. What you need to is use string append() or +-operator to add characters to string. - String indexing start from 0, like most indexing in C++ - If you want to loop user string from 0..length-1, you … | |
Re: What is the purpose of the inner for-loop? That's where you write the same result multiple times. What do you mean with a result? Your duration variable doesn't change at all during the program. At this moment you are writing 20x20 times duration to results.txt. | |
Re: One way, is to change your form method to "POST". That way, no query strings (?blahblah) are generated. | |
Re: Static data, also known as class data, is the same for every object of a class. In this case static data members will not help you. Since you are creating a Person objects in your Form1 ( Unit1.cpp ), you must either: - pass the Person objects as a reference … | |
![]() | Re: Associative containers are kept in order. I suggest you take a look at [URL="http://www.cplusplus.com/reference/stl/set/"]std::set[/URL], which allows using a comparison class. This class keeps the set in order automatically. I'm not sure how you should handle 3 different sorting criteria for 4 classes. This would end up in 12 different containers. … |
Re: First off, you shouldn't implement functionality in a struct. Call it a class if you want functions, besides construct/destructor. The problem is with the add function. You always add a new node behind the head-node (line 40), you don't swap the curNode-variable to the new added node. You have one … | |
Re: I suggest Client and Server classes with [I]remoting[/I]. | |
Re: QIODevice is a base class for basically anything in Qt that can be considered a read/write device, such as QFile. In the function call [CODE]int get ( const QString & file, QIODevice * dev = 0 )[/CODE] -QString reference file is the source on the server -QIODevice pointer variable dev … | |
Re: Math.sin function wants the angle in radians, not degrees. 360 degrees would be 2*pi radians. | |
Re: I don't think you'd need to call Person, since Teacher and Student constructors already call it. | |
Re: You are reading one number at a time into the array from input file and comparing it to the next, [U]which has not been read from the file yet[/U] (line 20). That's why your counter always stays at zero, content of array[i+1] is random. You must read consecutive values from … | |
Re: Including libraries in your header file is safe, but might get slow if multiple other files include that header file. Try to think where in your code you need what service from what library. | |
Re: If your server's IP-address is truly static, you could hard-code the server IP address in to the client program. Since it's the only address(is it?) the client is supposed to receive UDP-datagrams from, in this case it is perhaps acceptable. Usually this is not the way to do it though. … | |
Re: Please use code tags in the future. In your first do-while loop, you only print out the possible choices for mathematical operation. You never ask/receive the input for choice (assumption;from std::cin) and your integer choice will never change thus the infinite loop. Also you should initialize choice to some integer … | |
Re: You should try what Milton said. Application object can be found in System.Windows.Forms namespace. | |
Re: Case sensitivity! your declared function [CODE]int combat();[/CODE] does not match your implemented [CODE] int Combat () {[/CODE] function names must match in correct case | |
Re: You're either trying to declare or implement functions inside your main function, that's not a good idea. Functions should be first declared outside of main function: [CODE]bool PalindromeTest( );[/CODE] and then implemented, usually after main function [CODE] bool PalindromeTest ( ) { // implementation } [/CODE] Note: no semicolon in … | |
Re: -Executable project type generates a runnable program -Shared library project type generates a dynamic library (equivalent to windows DLL) -Static library project type generates a static library You will most likely want to use executable project since this is your first time writing C++ in a very long time. Just … | |
Re: Once again, the solution is to implement a string2int function. It will convert digits from string form to int form (if they are given in the right form). String2int implementations are found on this forum. You might want to implement your own function which would also separate the months/days/years using … | |
Re: Say you have for example polynomials a and b. Polynomial sums are calculated by summing the coefficients of the same power terms. So first you have to figure out how many terms the polynomials have and work your way down from there using a loop. [CODE]maxdegree = max(a.degree() , b.degree() … | |
Re: Your code is looking ok for a strapping young coder. I think your problem lies here: [CODE]display_Desig == "Labor";[/CODE] Here you're trying to [U]compare[/U], not assign. Use only one = to assign. Which raises even more questions, I'm not sure if you should try to assign a string into a … | |
Re: Very interesting problem! I don't think it's possible to create such a copy constructor for base class since the base class doesn't have a clue of the classes derived from it( and that's the way it should be). In your case I would use pointers to object in the map … | |
Re: isn't BoardTests an array full of TestInformation pointers? if so, you should refer to a single unit in the array as BoardTests[i]->TestPointer or *(BoardTests[i]).TestPointer | |
Re: I'm not sure, too lazy to check it, but I believe getline function returns false when it fails, in your case file ends. Of course catching an EOF exception is better... | |
Re: I can give you some direction via point-to-point if that helps.. 1. Open and read the file into an structure that supports iterators. 2. Create an iterator to the structure. 3. You can easily point your iterator (at least with STL) to the end of the file with iterator.end() 4. … | |
Re: Creating such if-else logics is tricky. Remember you're talking to a compiler through C++, not another person. The compiler will not be able to generate the correct true or false you want from your conditions. I suggest you approach the problem a different way, perhaps through a variable which you … | |
Re: How does using '\n' not work? It won't compile, crashes if you hit enter or pressing enter does not terminate the loop? | |
Re: Try using std::endl instead :) endl stands for end line, and is used for switching rows in console based C++ applications. | |
Re: I would take the data from stringstream to a temporary string, maybe 2 temporary strings. After that I could make_pairs out of them and insert them into the map. Not sure if that is the best option, and in that case the stringstream would not even be necessary. There might … | |
Re: does your class doublylinkedlist know what a class Node is? if not, trying to create a pointer to one will surely result in an error. EDIT: I tested it and that wasn't the problem. I used the Visual Studio pre-compiled header, fixed the lines 7&8 in doublylinkedlist.cpp ( &newNode ) … | |
Re: I think you should check how %-operator and casting a float into an integer work :) | |
Re: vector sizes are always in unsigned integers, so change the for-iterator i into an unsigned int. | |
Re: [url]http://www.cppreference.com/wiki/c/math/sqrt[/url] Use doubles or floats, the function returns the square root. | |
Re: I think he's just implying that the [b]array a[/b] is of [b]n length[/b]. a[0] would be the first and a[n-1] the last slot in the array. | |
Re: One way springs to mind, might not be as effective as a linked list, but still... First, create a struct of a data you want e.g. struct Actor, containing the info given to you. Then push these Actors in to a vector, deque, table, whatever you want, sorted by the … | |
Re: Someone linked these YouTube video tutorials, I think you should check them out. [url]http://www.youtube.com/watch?v=Jud497WjF-E&feature=fvst[/url] | |
Re: Don't think anyone will write the code for you, too bad I don't really know C to begin with. I bet you can find very similiar threads in the C++ forum history. If not, you should check getline, << and maybe string2int | |
Re: Could you explain a bit more what you are trying to do? :) [code] operation1* sjob = new operation1(); answer* ans1 = operation1->execute(); delete sjob; [/code] shouldn't you operate on sjob since you have created it? creating an object with new and then deleting it just seems like a waste … | |
Re: Quick, before the mods get here! Add the code tags ! | |
Re: Your problem is the way you are shifting your strings in the ostream [code] outfile << name << endl; outfile << address << endl; outfile << number << endl; [/code] address and number are not connected to the name in any way. note: avoid using global variables, declare these in … | |
Re: It's not about the digits in your pi. It's just the way sin() function works, not much you can do about it. If you really want the 0.0, write an if :P | |
Re: first of, include stringstream library. sort-function cannot use swap-function because it hasn't been declared before its called.\ and finally, indexing your itemlist-array like this [code]Item1[i].unitPrice[j]; [/code] will not work. For every item in your list there is only one unitPrice. | |
Re: tolower() doesnt work on Ä , Ö or Å. I think you have to do an extra check if the letter is one of those ( I'd say use switch-case ) EDIT: sorry, you already did that :D Anyways make a function which you call for each character individually, dont … | |
Re: The bitwise operation [CODE]inFile >> LstNme>> Id>> Age>> Gpa ;[/CODE] should work. Wish I could say the same the rest of the loop. [CODE]LstNme=LastName[i];[/CODE] If youre trying to save LstNme in the Lastname-array, these should be the other way around. the for-loop doesnt really do anything, except save the same … |
The End.