49,757 Topics
| |
Hi! I'm trying to count the number of occurrences of each word in a text file. But program put in the file the first symbol of inputed word only (line 34) and don't enter in the for-statement (line 51). What should I serach for in my code in order to … | |
First of all I apologize if the title is a bit vague, I couldn't phrase my question to fit in the given space. So given you have an array of floats that you want to cast as a pointer to a struct containing only floats, assuming the array size is … | |
the code is the following : BSTR MethodName = SysAllocString(L"DefragAnalysis"); BSTR ClassName = SysAllocString(L"Win32_Volume"); IWbemClassObject* pClass = NULL; hres = pSvc-> GetObject (ClassName, 0, 0, &pClass, 0); IEnumWbemClassObject* pEnumerator = NULL; hres = pSvc-> ExecQuery ( bstr_t ("WQL"), bstr_t ("SELECT * FROM Win32_Volume"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); IWbemClassObject *pclsObj; … | |
Hi. Can someone tell me how to output a two-dimensional priority queue please? In particular I am using an array of priority queues. The method I use to output an array of vectors is not working. I will show the one that is working (array of vectors): if(!diskQueues[i].empty()) { for … | |
I have been working on this for a few days now and I am having trouble understand how to create a paralell array between the seatList and seatPrices so the user can reserve that seat. I was wondering is someone could explain how it would work so I can write … | |
hi guys i need a small help about drawing gragh. program should include [this](http://postimg.org/image/xmx2aagxr/) user interface. User will enter a and b values then click the draw button. Then program should show the graph of function. i will add the type of function and the formula of it, if anybody … | |
Hello funs2code! I have the following problem. I need to count the number of occurrences of a concrete word in a text file. I've tried to count the number of occurrences of each word at first. The following code has no errors but it isn't working! When I type in … | |
Hi, I am new to ASP.NET and I have a challenge here: I have to create a webpage which should take C/C++ program from textarea and should produce output of the program below the textarea using label when a button is clicked on the webpage. I have no difficulty creating … | |
I'm working on a C++ program to convert MPH to minutes and seconds. I'm stuck. This is my code so far. It runs, but when I key a value (i.e. 6.5), the program crashes and stalls. What I am overlooking? | |
Hello I'm new to programming in general and this was one of the assignments I did. I was suppose to create a class called employee that includes three pieces of information as data members - first name, last name, monthly salary. Then was suppose to write a test program that … | |
Hi. I try to change the text color of console in C++. I know some commands like . system("color fg"); But I want to change the color of only one line of console. Is this possible? Would someone help me, please? | |
Hi I've got most of the code finished but I can't for the life of me figure out how to correctly count neighbors for the edges and corners of the array. These are the rules. If the cell is currently empty: If the cell has exactly three living neighbors, it … | |
Hello so hopefuly someone can help me but i cant seem to find the error and my teacher is in Flordia for the next week so i dont have him to ak for help. So my project was to read input from 11 .cpd files one at a time and … | |
I am trying to set up a program that will allow the user to be able input the size of sn object and then build an array from the inputted size. So basically have cin << size -then- int positioan [size] I am getting an error about having the array … | |
hello .. i just need a lil guideline... m making a program where i have to apply counting sort on the data which is comma seperated and it is written in a text file like this 59,54,40,79,38 28,98,77,71,74 24,91,56,82,51 74,36,98,29,41 39,10,52,3,24 30,5,4,70,15 29,55,40,56,23 8,94,69,13,37 79,96,54,53,29 12,29,30,99,35 63,87,64,6,6 65,56,80,37,89 total no. … | |
what is cin>> nd cout<<.whats the purpose of these in c++ or programming??? | |
my code is showing some problem, what i want it to do is that when the user hits space a ^ is shot from the position of the user and it moves +1 along y axis. here is my code: x2 = x; y2 = y // x = 50 … | |
Assist me with a code to write a program that creates an array to hold bank balances for a bank's 20 clients .The program should display the average balance as well as highest and lowest balances in C++.I was given this as an assigment thanks in advance people | |
Hello, I have code which uses the Boost formatting library. When I try to compile the code, it gives me a single error. The code looks as follows: #include "stdafx.h" #include "DataStructs.h" #include "FileIO.h" #include <sstream> #include <boost/format.hpp> ... void SaveSingleReads() // Save the single wavelength scan(s) to a file … | |
Simple Plotting of a function is to display its values within an interval [a, b] using simple symbols. For example, plotting f(x) =ax3+bx2+cx + d in the interval [x1, x2] is to display the points: (x1, f(x1)), (x1+dx, f(x1+dx)), …, (x2, f(x2)) on the screen. dx is an increment used … | |
I'm supposed to create a program to sort a names.dat file. It compiles but nothing is displayed. names.dat Collins, Bill Smith, Bart Michalski, Mel Griffin, Jim Sanchez, Manny Rubin, Sarah Taylor, Tyrone Johnson, Jill Adams, Andrew Moreno, Juan Wolfe, Bill Whitman, Jean Moretti, Bella Wu, Jeff Patel, Renee Harrison, Rose … | |
#include <memory> #include <deque> void MyFunc { std::deque< std::shared_ptr< Sprite* > > SpriteList; func_to_fill_deque( SpriteList ); for( auto i = SpriteList.begin(), end = SpriteList.end(); i != end; i++ ) { SpriteList[ i ]->spriteFunc(); // doesn't work SpriteList.at( i )->spriteFunc(); // also doesn't work } } void func_to_fill_deque( std::deque< std::shared_ptr< Sprite* … | |
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, … | |
| Hi, i have problem .I want to load infomrations abour person from text file. There is name, surname and some unlimited poin.We dont know how many points there is. i try to put this informations into vector<struct> person struct{ string name string surname vector<double> points } than i want to … |
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, … | |
|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 … | |
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 … | |
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: … | |
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 … | |
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 … |
The End.