- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 8
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: You coded something? Try it yourself first, if you have any problem then we'll help. | |
Re: [*]Write a program that accepts XHTML, parses and removes the tags. Then it prints out the remaining text. (Intermediate) We have to just remove the tags and display the rest? | |
Re: Its working at my end .. Can you specify the error? And please use CODE tags. | |
I am implementing RSA in C++ and here's my design(code structure). *keygen.h* namespace rsa{ class keygen{ public: //Constructor keygen(size); //Generate keys void generate(); //Getters string gete(){ return xyz; } .. .. .. private: //initializes bignums void initall(); keygen(){} //Private Member variables goes here } } *prime.h* namespace rsa{ //First 100 … | |
Re: What do you mean by removing the necessary elements from an array? Do you want to output increasing elements in an array and remove the smaller ones that comes after them? | |
Re: [QUOTE=coolbeanbob;1691247] I have another question. When I initialize x to 0123, x prints to the console as 83. Why is this?[/QUOTE] When you prefix a number with 0, its treated as octal. I think now you can figure out why 83 is getting printed :) | |
Re: [QUOTE=jpd5066;1687014][CODE]#include <iostream> #include <cmath> using namespace std; int main() { double posNum = 0, posPow = 0, sum = 0, newVal; int counter = 0; while ((posNum != (-1)) && (posNum >= 0)) { counter++; cout << "Enter a positive number (-1 to exit): "; cin >> posNum; if (posNum … | |
Re: Can you please provide some testcases for testing? | |
| Re: What error did you get when you try to compile? |
Re: Binary Search continuously divides the array and keep on searching for the target value whereas in your code the function doesn't do that. It just checks whether the target value is at mid and then changes first and last and then terminates. You would like it to continue searching rather … | |
Re: On the right track!! The program is reading the file and displaying all the names with index correctly but you need to include string header file. Now for your question, ask the user to enter a string and then start comparing it from the start of vector. Something like.. [CODE=C++] … | |
Re: First, you are calling the factorial function before taking the input from user i.e. num is not initialized. Secondly, the loop inside factorial function is infinite. It is supposed to run from 1 to num, but watch carefully you are multiplying num inside it so it'll keep on increasing and … | |
Re: Yes, cout is a variable but of type ostream. To be more precise its an object of class ostream which has << as overloaded operators. So whenever you use that operator on cout, it performs output to the screen. | |
Re: You can use this instead..[CODE]cin.getline(charArray, 80);[/CODE] | |
Re: Your code compiles fine? Because length is a function and you are trying to use it as an array [CODE]user.length[i][/CODE] | |
Re: Any code would be greatly appreciated. | |
Re: Problem is not in your code but your logic. The expected output seems to be using compound interest but you implemented simple interest. Try.. [CODE] float raisep = (raise/100); for(int i = 0 ; i < (years) ; i++) { cout << (i+1) << " $" << wage << "\n"; … | |
Re: If you want to display a char[] or pass it to a function just use the identifier, not the index. And word[50] is a character which doesn't exists. When you declare an array A[50], the index ranges from 0 to 49. | |
Re: You are changing the value of variables(a, b and c) while computing the sum of their digits. [code=C++] a=a/10; [/code] Then you compare them with the sum. | |
Re: You are passing the wrong second parameter to getline(), it expects a string. You are passing it a char.. [CODE=C++]getline(file,inf[rows][cols]);[/CODE] | |
Re: You are allocating new memory every time you call *pVketor() and I think that's the problem. | |
Re: Flush the input stream after input... [code=C++]while (cin.get (temp) && temp != '\n');[/code] | |
Re: Instead of [CODE=C++]cin>>str[/CODE]Use [CODE=C++]getline(cin,str);[/CODE] | |
Re: When you print low to high using loop, you incremented num1 and therefore the second loop never runs. | |
Re: The function main() expects a return value. Other than that your code works fine.... [CODE]return 0;[/CODE] | |
| |
Re: Read words from a paragraph, compare them with some equation(what type of equation?) and then add it to a string if it matches? Did I get you right? | |
Re: You want to find the totalcost for each group? | |
Re: You need to understand the basics of pointers, before dealing with linked lists. [CODE=C++]test->Next=Head; Head=test;[/CODE] It adds the newly created test node as the first node in the list. Before adding the list is [QUOTE]Head -> First -> Second -> Third...[/QUOTE] After adding, it will be [QUOTE]Head -> Test -> … |