49,761 Topics

Member Avatar for
Member Avatar for pdk123

Hello , I have map of the following type: typedef map < int, vectorofInts > , Now the map has finite size. Each user when he registers, he will be allocated a key. Lets say the map size is 4. U1 will be allocated in K1. next U2 on K2, …

Member Avatar for tinstaafl
0
179
Member Avatar for phony

|29|error: expected unqualified-id before ‘{’ token| |27|error: new types may not be defined in a return type| |27|note: (perhaps a semicolon is missing after the definition of ‘DynStack<T>::StackNode’)| 46|error: ‘StackNode’ does not name a type| ||In member function ‘DynStack<T>::StackNode DynStack<T>::StackNode(T, DynStack<T>::StackNode*)’:| |40|error: ‘value’ was not declared in this scope| ||In …

Member Avatar for tinstaafl
0
1K
Member Avatar for marirs07

Hi, Im quite new to SerilaPort handling.Im trying to open a serial communication on a particular COM port.Im able to Open a new one by using CreateFile(L\\\\.\\Com5, GENERIC_READ | GENERIC_WRITE, 0, // exclusive access NULL, // no security OPEN_EXISTING, 0, // no overlapped I/O NULL); But I want to do …

Member Avatar for BobS0327
0
387
Member Avatar for OM3NN

Hello, please help me to resolve these question c++, I try to answerd it but i do not understand anythings(": 1- A program should red in values until a negative value is read. It should determine the smallest value that was read and display that value once the loop stops: …

Member Avatar for pritaeas
0
248
Member Avatar for shelton22

Hi Friends! If I have number of arrays with fixed size (15), it consist of zeros and non-zeros. eg: array1[15]={5,5,0,0,4,4,4,0,0,0,1,0,0,0,3} array2[15]={1,0,0,0,0,7,7,0,0,3,0,0,0,0,2} array3[15]={6,6,6,0,8,8,8,0,0,0,3,3,0,0,4} ........... How can I count the common zero sequences and there indexes of arrays? sample output for the above arrays: Index Nim_of_zeros 3 1 7 2 12 2 …

Member Avatar for iamthwee
0
504
Member Avatar for XodoX

I found this site http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/ If I have a server-client code and this: clock_gettime(CLOCK_REALTIME, &time_a); // create socket clock_gettime(CLOCK_REALTIME, &time_b); // close socket If I have a and b wand want to measure the time it takes to communicate, what's the best way ? Still not fully understanding the exact …

Member Avatar for NathanOliver
0
259
Member Avatar for glamiex

//Reading the last name from the file ifstream file; file.open("studentName.txt"); char name[20] ; file>>name; cout<<"The last user was: "<<name<<"\n"; file.close(); //Replace the last student name with the new one in the text file cout<<"What is your name?: "; cin>>name; name[0]=toupper(name[0]); ofstream file2; file2.open("studentName.txt"); file2<<name; file2.close(); When I run the program …

Member Avatar for wrathness
0
180
Member Avatar for Mr.UNOwen

Hello, So I'm aware that OpenGL is Column major and DirectX is Row major, but how does that translate into a basic 1D array? So given the below visual matrix, what would the first 3 in the array of each platform and which 3 would be the x,y and z …

Member Avatar for Mr.UNOwen
0
2K
Member Avatar for Jsplinter

I have an array of 3,000 floats: `float *mVec = new float[3000];` and I need to take the log of each element. I am translating MATLAB code, in which everything is vectorized (ie, log(mVec) does some parallelization behind the scenes). There must be a better way to do this than …

Member Avatar for mike_2000_17
0
201
Member Avatar for glamiex

private: GradedActivity *grades[NUM_GRADES]; public: void setLab(GradedActivity *activity) { grades[LAB] = activity; } Totally confused with this one.

Member Avatar for rubberman
0
201
Member Avatar for ivan3510

Hi! A task was to solve a problem using threads (sum up two arrays), but so that you have a global const which will represent number of threads you want to use. Somehow, this doesn't work, and Im not sure if this is correct way to do it. Thanks for …

Member Avatar for ivan3510
0
4K
Member Avatar for morqan.leo

iclude<iostream> using namespace std; int main() {cout<<"hello daniweb"<<'\n'; return 0; }

Member Avatar for Moschops
0
55
Member Avatar for Sarkurd

Hi i created a text file and put some numbers to it but when i read from it, the last number will be printed out twice #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream newfile("numbers.txt", ios::out); if (!newfile){ cout << "File not found" << endl; …

Member Avatar for Sarkurd
0
172
Member Avatar for bejfake

Hi, I need to implement list based on dynamic arrays (second task is to implement as double linked list). Both tasks are done, but I have problem with time limit on test platform when values are millionths. I suppose that resizing dynamic array is delaying so much. I have implemented …

Member Avatar for rubberman
0
1,000
Member Avatar for noor.ulhuda.372

hi.i am new to c++.i need to make hangman game for university project.could some on tell me what is the problem with this part of the code?thanks in advance #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #include <string> #include <windows.h> using namespace std; int main() { //variable declaration string …

Member Avatar for StuXYZ
0
193
Member Avatar for programmerUSM

hello.. i need to develop an application form which will be used nationwide.once user complete fill in the form,reference number will appear.So i need to create reference number,there is no specific digit required as long as it is unique number/combination.can anyone teach me how to create the reference number? is …

Member Avatar for programmerUSM
0
185
Member Avatar for chubbyy.putto

I dont know what is wrong. The output didnt show anythin. FYI I have p6.dat on same dic. it just the out put didnt print the number. #include <iostream> #include <fstream> using namespace std; const int mySize = 15; const int myStop = 3; void impliedTask(int *&,float *&); int main …

Member Avatar for Ancient Dragon
0
174
Member Avatar for newbiewwcode

Member Access Operators: . and -> http://msdn.microsoft.com/en-us/library/b930c881.aspx I read the above article and played around with some codes. I thought line 25 and 26 would work but they didn't. Can you guys please tell me why? Thanks for helping! #include <iostream> using namespace std; class State { private: int* state; …

Member Avatar for newbiewwcode
0
200
Member Avatar for costigan555

I am having a little bit of trouble finishing a project I have made for myself. Also, before we begin, it is important to note I don't have much experience with C++ programming and programming in general. I realize my code is probably not the most efficient or even elegant. …

Member Avatar for iamthwee
0
367
Member Avatar for bushra mahboob

You are required to write a C++ program using loop and switch statement. The program should display even or odd numbers from 1 to 50 depending upon the option given by the user.

Member Avatar for iamthwee
0
102
Member Avatar for Alxprog

Wikipedia page on DVDVideoSoft says it's written in C++ Qt and C#. So my question is this : in particular regarding the above mentioned product and in general what's written (or should be written) in C++Qt and what in C#?

Member Avatar for Alxprog
0
637
Member Avatar for l3the

Hello to all programmers. I have joined this forum newly I decided to learn c++. Is there any video tutorial source for beginners that you know ? Thanks for your help

Member Avatar for Suzie999
0
360
Member Avatar for candyandy212
Member Avatar for bejfake

Hi, I have such simple structure in unmanaged C++: struct Cam { char ip[16]; char login[16]; char pass[16]; char name[16]; }; and C# marshalled structure: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public struct Cam { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string ip; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string login; …

Member Avatar for bejfake
0
2K
Member Avatar for Mhayt

Hello How to solve this ?I got mad because of this quation Write a menu driven application using C language that performs some searching and sorting operations. Your application should be able to perform linear and binary search. In addition, it can perform sorting using one of the sorting algorithms …

Member Avatar for pritaeas
0
152
Member Avatar for bejfake

Hi, I start with code: int main() { Dict d; int n; std::cin >> n; char word[100]; for (int i = 0; i < n; i++) { std::cin >> word; d.addWord(word); } d.addWord("dog"); d.addWord("drog"); .... return 0; } I don't know why when I call method addWord manually, i.e. calls …

Member Avatar for bejfake
0
241
Member Avatar for chubbyy.putto

I got an error: -Functions that differ only in their return type cannnot be overload (#8) -Implicit conversion loses integer precision: "time_t'(aka "lomg") to unsigned int (#14) -Implicit cnversion loses integer precision: long to int (#18) -Functions that differ only in their return type cannnot be overload (#24) #include <iostream> …

Member Avatar for chubbyy.putto
0
159
Member Avatar for Mhayt

Hello How to solve this ?I got mad because of this quation Write a menu driven application using C language that performs some searching and sorting operations. Your application should be able to perform linear and binary search. In addition, it can perform sorting using one of the sorting algorithms …

Member Avatar for Ancient Dragon
0
243
Member Avatar for Sarkurd

Hi i tried to do some training and write '==' operator to compare between two vectors but i got this error Error 1 error LNK2005: "bool __cdecl operator==(class vector,class vector)" (??8@YA_NVvector@@0@Z) already defined in Source.obj c:\Users\Sarbast\documents\visual studio 2013\Projects\Overloading Vector\Overloading Vector\Vector.obj Overloading Vector Vector.h #include <iostream> using namespace std; #ifndef VECTOR_H …

Member Avatar for Sarkurd
0
380
Member Avatar for basil60

Hi I'm a noob. Can anyone please explain why I get a "'ranum' was not declared in this scope" error in this script? I was obviously using Arduino. void setup() { pinMode(13, OUTPUT); pinMode(12, OUTPUT); pinMode(10, OUTPUT); pinMode(09, OUTPUT); double ranum = rand()%11; } void loop() { if (ranum==0){ digitalWrite(13, …

Member Avatar for richieking
0
2K

The End.