49,761 Topics
| |
[code] Mat_<double> const affine = (Mat_<double>(2, 2) << 0.5, 1, 0, 2); Mat_<double> coordinate = (Mat_<double>(2, 1) << 20, 3); Mat_<double> C(2, 1); C = affine.mul(coordinate); // this line would crash the program C = affine * coordinate; // this line is ok [/code] I don't why and how, did … | |
I would like to program that reads a file with 6 lines that have 7 numbers on each line. The output should save a file with sum, average, max and min of each line. For now I just have to figure out how to get the max and min numbers … | |
Hi guys, I just started to learn class in C++ and get confused by some of the codes [code]class FLATMATE { string name; public: FLATMATE() { name = "";} FLATMATE(string n){name = n;} string getName(){return name;} void setResident(string n){name = n;} }; //Below are the base class for different duty … | |
Hi, This is what I have done so far (below) I'm having a problem with the spacing as shown in the output (below the code) Can anyone please help me fix the spacing? Thank You!! ************************************************** ************** CODE: [CODE]#include <iostream> using namespace std; void question (int input); void calendar (int … | |
hai, i was wondering if you guys had any advice on getting into game programming with c++ i have a pretty basic understanding of the language and was trying to find out how to do this kind of stuff but so far i havnt been able to find out much. … | |
Hey guys, ive just started learnng c++ after a year or so of java, one issue that has just cropped up for me is repeating input from console. if for example i ask for an input, expecting just 1, and the user inputs 2 with a space inbetween how do … | |
[code] void Sort() { int Holder, k = 0; srand( time(0) ); // seed random number generator while ( k < HowMany ) { Holder = rand(); // generate random number to Holder if ( Holder > 10 && Holder < 100 ) { Numbers[k] = Holder; k++; } } … | |
So I have an assignment to redefine an array-based Stack push() function. The problem itself sounds like it totally defeats the purpose of a stack, but this is what I have been assigned: Rewrite the push function so 'myTop' is always 0 instead of one more than the index of … | |
I need to write code that can determine if an IP address is in a subnet based one the subnet address and mask. I don't even know where to begin with this, so any tips would be appreciated. Thanks. | |
#include "p2.h" #include <iomanip> #include <string> using namespace std; /* * Converts an amount measured in cups to milliliters. * 1 cup = 236.518538 milliliter * * cups - amount measured in cups * * returns amount in milliliters */ double convertCupstoMilliliter(double cups) { //modify -1 below to be your … | |
I have given instructions to write some code and i have to follow the comments giving and i get stuck and some point so can anyone tell me what i did wrong /* * Returns the percent change from the original to the desired servings. * The percent is expressed … | |
Project Makcik Minah has opened a new children art class. During the Registration Day, 30 children have registered. Makcik Minah’s assistant, Munah has manually obtained information from the children that include name, birth certification number, date of birth and gender. All these information is required in order to divide the … | |
So, in the course of a simulation of a neural network I have two classes: neurons and synapses (which are basically the coupling between neurons). Synapses mediate information between neurons, so a neuron has to be able to speak to a synapse, and that synapse has to be able to … | |
Why a i getting this message after i compile my program c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(main.o):main.c|| undefined reference to `WinMain@16'| [CODE]/* * p2.cpp * * Created on: Oct 7, 2010 * Author: saturner */ #include "p2.h" #include <iomanip> #include <string> using namespace std; int main (); /* * Converts an amount measured … | |
Im having trouble with this program. I attached a picture of what is required. Thanks for any pointers you guys :) p.s. I'm very new to this. | |
Hi. ----- Thanks for reading ... I want to write for example: ln 3 Is there is any command or function for it ...! | |
[COLOR="Green"]hi; i am doing a homework(due tomorrow) and i have a problem with it; when I compile the program it shows no errors, and it takes input ,but does not show the output using function print(); note :the function of the program is to take elements from user,stores them in … | |
Hi, the code analysis tool we use gives below warning for the functions in which memset / memcpy is used "The function writes outside the bounds of dup on line 303, which could corrupt data, cause the program to crash, or lead to the execution of malicious code." could someone … | |
What I want to know is if I can call a function defined in a C++ class in Visual Basic through a .dll generated from VC++2010? Is this possible, or do I need to define the .dll with C++ raw functions outside of a class? For example, my class looks … | |
The output of this code shows only one student's informations. But I want to display the all students' informations. Please find what is wrong? | |
I need to use arrays, insertion sort algorthm to come up with a program tht will sort 3 employees salaries in an ascending order after user has inputed data..thus EMPLOYEE1:20000 EMPLOYEE2:15000 EMPLOYEE3:10000 CAN SOMEONE HELP WITHE THE FUNCTION TO MAKE MY PROGRAM DO THAT PLEASE! | |
I'm planning to buy a few books for C++. I want to learn C++ at it's deepest. You may say, I want to be C++ program developer. I'm currently having C++ in my study courses too. Which are recommended books? This thread has a huge list of books. Don't think … | |
This is what I have to do. Write a program that has a Fibonacci number calculating function. The function will take an integer as a parameter which is the Fibonacci number to calculate, and return the Fibonacci number. Then use this function to calculate the sum of every Fibonacci number … | |
I need to put the names entered by the user in alphabetical order. What are my variables to declare? Im wanting to use something like this in my code but do not know what my array is or anything. selection_sort(arr1, arrSize); [CODE]using namespace std; int main () { string temp; … | |
This is the output: Amount: 69.73 Dollars: 69 Quarters: 2 Dimes: 2 Nickels: 0 Pennies: 3 this is NOT ONLY for 69.73. It's any amount in general. I know how to figure out the amount of dollars needed. But how would you figure out how many quarters, dimes, nickels, and … | |
so im calculating the avergae of 5 numbers ive put in the array but when i compile i get a very large number heres my code [CODE]#include <iostream> using namespace std; int calcAverage() { int sum=0; int average; int TESTVALS[5] = {2, 18, 1, 27, 16}; for(int i = 1; … | |
Hi! I'm new this semester to C++ and it is a little difficult for me. Our class has a project where we need to implement functions. While I got the very first one right, I'm not sure what to do about the others that are similar to it. Can anyone … | |
This is the assignment: Purpose: The purpose of this assignment is for you to demonstrate your ability to design and code a program that employs a multi-decision construct such as else...if, or switch to resolve a problem that has a multiplicity of conditions to be evaluated. Use the else...if for … | |
I know how to get it, basically. It's just for my program, it's 362 minutes. That is 6:02. The thing is it's ZERO two. I don't know how to get the zero and then the two? | |
i know the minimal basics of a lambda function, could someone give me the breakdown of each part in the function |
The End.