49,761 Topics

Member Avatar for
Member Avatar for catdieselpow

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 …

Member Avatar for nana121
0
124
Member Avatar for miturian

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 …

Member Avatar for arkoenig
0
183
Member Avatar for ziarczak

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

Member Avatar for Luther von Wulf
0
92
Member Avatar for furtaker

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 …

Member Avatar for Luther von Wulf
0
245
Member Avatar for hanvyj

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 …

Member Avatar for Stefano Mtangoo
0
5K
Member Avatar for loushou

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 …

Member Avatar for daviddoria
0
135
Member Avatar for ithelp

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

Member Avatar for mike_2000_17
0
131
Member Avatar for danny.chungie

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

Member Avatar for ithelp
-1
150
Member Avatar for farooqaaa

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

Member Avatar for farooqaaa
0
256
Member Avatar for elsiekins

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

Member Avatar for elsiekins
0
266
Member Avatar for server_crash

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 …

Member Avatar for brkurre
0
215
Member Avatar for xheavenlyx

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 …

Member Avatar for stevephillips
0
216
Member Avatar for AdventGamer

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 …

Member Avatar for AdventGamer
0
117
Member Avatar for rcplguy15

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

Member Avatar for sfuo
0
120
Member Avatar for vishal456
Member Avatar for glamourhits

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 …

Member Avatar for Anyzen
0
179
Member Avatar for furtaker

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

Member Avatar for furtaker
0
454
Member Avatar for bobbuilder67

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 …

Member Avatar for sarah_10
0
2K
Member Avatar for Artifesto

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 …

0
28
Member Avatar for nsd11

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

Member Avatar for nsd11
0
487
Member Avatar for sDanyal

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 …

Member Avatar for dusktreader
-2
415
Member Avatar for PixelExchange

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 …

Member Avatar for PixelExchange
0
198
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
219
Member Avatar for potato4610

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

Member Avatar for dusktreader
0
283
Member Avatar for neelm

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]

Member Avatar for hanvyj
-5
56
Member Avatar for helpme87

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 …

Member Avatar for helpme87
0
149
Member Avatar for jrdark13

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.

Member Avatar for Ancient Dragon
0
86
Member Avatar for palunix

what is the best C++ IDE that i can consider it as strtting point to use it in developing thank in advanced, IYad,

Member Avatar for palunix
0
184
Member Avatar for georgialucas

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 …

Member Avatar for Fbody
0
107
Member Avatar for Kanoisa

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 …

Member Avatar for mike_2000_17
0
464

The End.