49,757 Topics

Member Avatar for
Member Avatar for daniwebrandom

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 // …

Member Avatar for jonsca
0
186
Member Avatar for Learning78

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 …

Member Avatar for WaltP
0
269
Member Avatar for axed

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 …

Member Avatar for axed
0
155
Member Avatar for theABCasian

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 …

Member Avatar for theABCasian
0
2K
Member Avatar for rkulp

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; …

Member Avatar for Ancient Dragon
0
170
Member Avatar for carol.f

hello,dis is caroline doing ma mca from blr i wanna know the concept of freind functions and classes used in library managemment sysytems

Member Avatar for Ancient Dragon
-1
35
Member Avatar for TauterTwiggy

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 …

Member Avatar for TauterTwiggy
0
81
Member Avatar for khaled.s

[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 << …

Member Avatar for WaltP
0
213
Member Avatar for ala0003

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 …

Member Avatar for ala0003
0
215
Member Avatar for tarheelfan_08

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> …

Member Avatar for tarheelfan_08
0
114
Member Avatar for atticusr5

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 …

Member Avatar for atticusr5
0
176
Member Avatar for richman0829

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 …

Member Avatar for richman0829
0
186
Member Avatar for richman0829

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 …

Member Avatar for richman0829
0
123
Member Avatar for muffinhead

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 …

Member Avatar for muffinhead
0
149
Member Avatar for clutchkiller

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 …

Member Avatar for StuXYZ
0
120
Member Avatar for dczet

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 …

Member Avatar for hsagar22
0
364
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
389
Member Avatar for sunlitdays

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 …

Member Avatar for WaltP
0
164
Member Avatar for react05

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 …

Member Avatar for WaltP
0
104
Member Avatar for KRal

/* 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 …

Member Avatar for WaltP
0
149
Member Avatar for Phil++

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 …

Member Avatar for Stefano Mtangoo
0
94
Member Avatar for khaled.s

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. …

Member Avatar for JasonHippy
0
162
Member Avatar for crozbme

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 …

Member Avatar for WaltP
0
100
Member Avatar for code zombie

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 …

Member Avatar for code zombie
0
118
Member Avatar for marshella

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), …

Member Avatar for nats01282
-1
317
Member Avatar for D4n1sD

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 …

Member Avatar for Fbody
0
99
Member Avatar for Ballistix

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; …

Member Avatar for Fbody
0
201
Member Avatar for timbomo

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 …

Member Avatar for timbomo
0
293
Member Avatar for yznk

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 …

Member Avatar for HealBrains
0
175
Member Avatar for sexyzebra19

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 …

Member Avatar for sexyzebra19
0
94

The End.