49,757 Topics
| |
C++ program creating array the uses the dot product? normalized dot product // Matches the Signal with the Pattern Signal using the "dot product" // of Signal and Pattern divided by the square root of the energy of each. // According to the Cauchy-Schwartz inequality, the result will be // … | |
Hi; I have a number of text strings in an access db file. I want to compare those text strings with the user input. I need to make sure that atleast 60% of the text input matches with the correct string to declare it a correct answer. e.g. for a … | |
Hi, I want to know when and where is memory allocated for static variables. If: 1) static variable is in a function 2) static variable is a member of a class 3) a global static variable inside a file of code. Much appreciated. Google hasn't been much of a friend … | |
i think im missing something could use a pointer heres the problem A palindrome is a string that reads the same backward as forward. For example, the words mom, dad, madam and radar are all palindromes. Write a class Pstring that is derived from the STL string class. The Pstring … | |
My professor gave use the code to a function that draws a line in the grid. I have made my class function but I am not sure how to use it with this function he gave us. [CODE]void drawLineInGrid(char grid[][MAX_Y], const Line &line) { int xDifference, yDifference, xIncrement, yIncrement, error; … | |
hello,dis is caroline doing ma mca from blr i wanna know the concept of freind functions and classes used in library managemment sysytems | |
good evening I was wondering if someone could walk me through creating a find and insert functions for the following class [CODE] //map of characters //class to create a map of words, character at a time and allow access to each character and store a list of lines //from the … | |
[CODE]#include <iostream> using namespace std; int main(){ for (int i = 0; i < 1000; i++) { int die1, die2, roll1, roll2, point,; die1 = 1 + rand() % 6; die2 = 1 + rand() % 6; point = die1 + die2; cout << "You rolled: " << point << … | |
I have been learning c++ and Allegro (graphics libary) for about a year, and have been trying to get this code to work (in particular, passing the array of classes), and when compiling i get the following errors C:\Documents and Settings\User\Desktop\npc.h In member function `void cNPC::NPCmove(cNPC*)': 96 C:\Documents and Settings\npc.h … | |
Can someone please help me get my code running! I am trying to do a sectional sort based on mileage. I have got a lot of code wrote based on the book, but I can not get it to work or figure it out! Please assist! Class [code] #include <iostream> … | |
Hey Everyone, I am trying to compile and run a program for my C++ class, and I am getting a Segmentation Fault as a runtime error. I looked at my code and my datafile to make sure that there was not an issue but I can not seem to find … | |
I seem to be inventing my own syntax here. The idea seemed simple enough: use the keyword 'new' to allocate space for a new integer array, and populate it with a few integers. Where have I gone wrong? [CODE] #include <iostream> using namespace std; const int SIZE = 5; int … | |
If I uncomment the 'int x;' above main, and comment out the int x = 0 inside of main, it works, but I don't want to use global variables. What I can't understand is why x is out of scope. The text I'm using says “vars having local or block … | |
I know *what* the problem is, I'm just not sure how to proceed... Here's the code I have so far: [CODE]void BinarySearchTree::writeIteratively(ostream& outfile) const { TemplateStack<Node*> stack; // this is to set up the actual stack Node* current = root; while (current != 0 || !stack.isEmpty()) { // here is … | |
I was just in class, learning about STL and class templates. My teacher said you cannot split the class declaration and the function definitions into the normal header/cpp file like you can with non template classes. Is this true, and if so why? I assume it would have somthing to … | |
I tried using a lib (svgacc) in Borland C++ both from source directory(i.e. bin) and lib and include directories(ofcourse after previously copying the in those dirs D:). The error is : Linker error: undefined symbol _videomodeget in module main.cpp . I tried building in a project of modules as well … | |
Hi All, I want to parse simple XML file and I was looking if there is C++ standard library classes for doing that. IF no what are good yet simple XML C++ third party libraries? Thanks | |
I am trying to write a code that calculates the end time of an event (in military time) based on 6 values the user enters: the starting hours, minutes, and seconds, and the duration hours, minutes and seconds. The user can't enter values greater than 24, 60, and 60 for … | |
Hey guys, I need to write a code to evaluate postfix expression. I started on it but now I'm stuck. Below I have what I started on and the file that it needs to go into. I need it to do the following: If the token is an operator of … | |
/* When I run this code the random numbers that are supposed to be generated will not cout. Any suggestions would be a great help!*/ [CODE]int main() { Fraction operand1, operand2, resultant; int a, b, c, n, d; char op, choice; //char opchar: srand(time(0)); system("cls"); //a.setAll(1); //1 indicates that it's … | |
Hey, I was just wondering, is it possible to create an application in C++ that once you dropped something onto it i.e a text file it would then upload to a server. For example: [code] // application checks to see if something has been dropped // get the name and … | |
I need to use this to make a program to find the prime factorization of a number, please help me get started. input a value to factor while input value > 1 let leftToFactor = input value let factor = 2 while factor <= leftToFactor while factor divides leftToFactor (i.e. … | |
I am trying to change the default value in a print function so that n > len, however, when I do so, the output has garbage at the end of it. How do I properly get rid of the extra characters? [CODE]#include <iostream> #include <assert.h> #include <cstring> using std::cout; using … | |
I am trying to make a custom stream class because for some reason standard string objects crash my program when i try to output them, i believe i know why now. When i tried to overload the << operator for a string object by making it a friend of my … | |
how to write a program in c++ for this type of question? Write a calculator program in c++ that allows the user to select which operation they would like to perform such as: Addition, subtraction, multiplication, division, modulus, Square, Square root, Convert Celsius to Fahrenheit (Fahrenheit = 1.8 Celsius +32), … | |
Hello I got a problem while trying to use rand() fucntion. Just by using it its self it generates a random number from 0 to RAND_MAX. The prob is that I don't know rand max, so how can I make a costume generation, like generating from 0 20 or 0 … | |
Hello I'm new to c++ i need help with a area and perimeter function. I can get the program to run fine with out using it as function but cant with trying to get it to run as a function. Here is my code: [code] #include <iostream> using namespace std; … | |
quick question how will i go about setting setting up characters to draw a shape such as a triangle. but the user must pick an odd # that equals to the shape . the one i have is simple but idk how to input the number the user choosen to … | |
Im working on a knights tour problem. And ive run into some issues. Im able to get the program to run randomly till it finds a full tour but how would i go about running it only a 100 times and then printing the average number of moves the knight … | |
I'm trying to use matrix multiplication to multiply b onto a. Using the method I've written below, changes the values of matrix A which I've then realised messes up later calculations. Would the best way to get around this be to make two copies of the matrices A and B … |
The End.