49,761 Topics
| |
using namespace std; int main() { vector<double> row(3, 0); vector<vector<double> > table(3, row); printVectorOfVector(table); Fill in a 2 dimension 3x3 array with odd numbers. The display shows the array as it is being filled. Use random integers to fill the array. Use numbers between 1 and 10. Initialize array to … | |
So, due to my last question, [url]http://www.daniweb.com/forums/thread303487.html[/url], I am becoming acquainted with the vector template. However, I clearly am not using the commands correctly. Below is a section of code which, eventually, leads to a segmentation fault later in the program. First an introduction of the variables: [CODE] using namespace … | |
Hello everyone, I'm having problems with this code: [CODE=cpp] #include <vector> using namespace std; template <class Type> class Some { private: vector<Type> elements; vector<Type>::size_type index; //THIS IS WRONG public: Some() { } }; int main() { } [/CODE] It doesn't compile, giving me [CODE] p.cpp:9: error: type ‘std::vector<Type, std::allocator<_Tp1> >’ … | |
Hi, I am trying to incorporate a struct and class in the same program to calculate overtime pay and hours for one person. I am having a hard time with these two and especially putting them together. I am not sure what to do to get the program to compile … | |
I have a problem casting a long to an int in c++ There is a long "biWidth" in the &pVideoInfoHeader->bmiHeader struct, I simply want to read this into an integer value "Width" [CODE=c]//check the video info header Width=(int)(&pVideoInfoHeader->bmiHeader.biWidth); Height=(int)(&pVideoInfoHeader->bmiHeader.biHeight); //break point here [/CODE] When I step through the code to … | |
okay i have an array of a struct. [CODE]struct MYSTRUCT { float myFirstVal, mySecondVal, myThirdVal; unsigned char myByte; } int myCountFunction(MYSTRUCT *&myArrayOfStructs) { int myCount; // question area return myCount; } [/CODE] here is my question. how do i count the number of elements in an array of type blah … | |
Hi C++ experts, I am looking for a script which given a structure made of basic types can generate a C++ class which encapsulate the structure and it also generates the stream in and stream out method for the structure e.g [code] input int a ; char b; string c; … | |
#include <iostream> #include <cctype> #include <fstream> #include <cstring> #include "ass1.h" using namespace std; const int MAXSIZE = 100; int records = 0; char Menu(); void ReadFile(); void DisplayRecs(); void AddRecord(); void SearchArray(); struct StudentRec { string Number; string GName; string FName; string subjects[4]; int results[4]; int numsubs; }; StudentRec StudentArray[MAXSIZE]; … | |
How to pass an array of struct as a function parameter? This is not working: [CODE] struct Person { char* name; int age; Person(char* name, int age) { this->name = name; this->age = age; } } struct XYZ { int count; Person* people[]; XYZ(int count, Person* people[]) { this->count = … | |
Hi, I have two Pthreads and two named semaphores, the semaphores are created within the threads, is there a way in which i can declare a semaphore in one thread and then open and use it in the other one ? Thanks | |
I may not be understanding private inheritance right, but I thought when you inherited privately that you could still access public member data/functions, but the child class of the derived class would not. For some reason it is saying the public print() method is not accessable in this context....Is there … | |
Before I ask the question I realize that selection of a programming language depends on the context of a problem at hand. Related to this I would like to know (if anyone) how many of you use which language for programming microcontrollers, embedded systems and even generally on PC. Here … | |
I'm currently working on a program with linked lists. The program asks you to enter five integers, and every time you enter one that integer is added to the front of the list. My issue is that for each input, i need to insert the node at the beginning of … | |
Write a C++ program that takes 2 characters (c and d), and a positive integer (n) and outputs the following drawing of size n n made of the characters c and d, as shown below: Enter two characters and an integer: # _ 6 #_#_#_ _#_#_# #_#_#_ _#_#_# #_#_#_ … | |
HII ... i was doing this program where i can enter student grades and the program will tell me like the over-roll grade .. and stuff .. i am almost done i think but i am stuck now soo plz if u can make this work plz help .. THANK … | |
I am trying to edit this program to pass two variables to the function call using a passing-by-reference. I need help as to how to modify what I have. Any help would be appreciated. #include "stdafx.h" #include <iostream> using std::cout; using std::endl; int incr10(int& num); // Declare function int main(void) … | |
Hello everybody, I am trying to communicate with a Vitamin Scanner from a computer, which connects via Comm port. It should do the equivalent thing of opening up 'Hyper Terminal', typing in 'a', hitting enter, then typing in '?I', enter, 'S', enter, and a long list of integers shows up … | |
I am currently working on a program in Visual Studio 2010 and am having issues with getting it to send files, actually I am having issues with just about everything. The program is designed to send specific files to an iPhone through USB. I know it is possible and I … | |
Very new to this. Trying to create a console application with code::blocks. I'm told when I Ctrl+F9(Build->Build) I should see 0Errors, 0Warnings at the end of the process. I', also told when I Ctrl+F10 (Build->Run) an output window should open and I should see my first program execute. "SayHello1 - … | |
This is a incomplete code Complete this code by using Dev C++ for practice[code]#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<strings.h> #include<iostream.h> #include<dos.h> #include<time.h> #include <cmath> #include <windows.h> void sleep( clock_t wait ) { clock_t goal; goal = wait + clock(); while( goal > clock() ) ; } void gotoxy( int x, int y … | |
Hello everyone. I have already read the "MySQL C API Programming" tutorial found at: zetcode.com/tutorials/mysqlcapitutorial. The problem is, the tutorial does not show how a person would display the results obtained from the [u]SELECT FROM[/u] statement in a char * format. Does anyone know if it is possible to convert … | |
Hi All, I have a question that I cannot figure out. I have DLL that will export class and some C functions. Should I enclose both definition (.cpp) and Implementation(.h) with extern C? something like below? myfunc.h [CODE=C++] class TestClass{ //some stuffs here }; extern "C" { void myFunc(int x, … | |
* I meant pointer parameters This function that has two parameters, both of type reference and return reference to pointer. Do I need to fix anything? I have been stumped for days and dunno what I should fix here is my code: [CODE]#include <iostream> using namespace std; double *ComputeMaximum( const … | |
Write a program in C/C++ for encryption and decryption using Hill Cipher[code]Write a program in C/C++ for encryption and decryption using Hill Cipher[/code] | |
so i am designing some software to prompt the user to enter their account number which in turn leads them to have to input their usage of ln. this then is to be displayed in a database file. i have all the code done for this. it reads in the … | |
I'm am in real need of the diskpart.cpp file and it's dependents from Windows CE 6.0 I don't have the time or requirements to download and install everything for Windows CE. It would be greatly appreciated. | |
what is the best C++ IDE that i can consider it as strtting point to use it in developing thank in advanced, IYad, | |
Hello everyone, I m a noob in C++, but I ve programing experience in rhinoScript and MayaMel. I m trying to write a C++ program that can that can: 1.start Maya + open a specific file 2.start Mel + execute some code for the moment I was able to write … | |
Hi all, Im wokring through NEHE's tutorials at the moment and building a cone approximation class to play with the code and learn from the examples but iv reached a snag. I cant get texturing the top curved part of the cone to work (i have called it a pyramid … |
The End.