49,757 Topics

Member Avatar for
Member Avatar for Auroch

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 …

Member Avatar for Auroch
0
255
Member Avatar for Mr.UNOwen

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 …

Member Avatar for Mr.UNOwen
0
177
Member Avatar for ala_2

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

0
129
Member Avatar for smitsky

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 …

Member Avatar for tinstaafl
0
924
Member Avatar for Paul_23

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 …

Member Avatar for Paul_23
0
522
Member Avatar for Adem_1

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 …

Member Avatar for Ancient Dragon
0
412
Member Avatar for Auroch

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 …

Member Avatar for Auroch
0
407
Member Avatar for hussainahmad28

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 …

Member Avatar for pritaeas
0
101
Member Avatar for aegugka

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?

Member Avatar for Hiroshe
0
1K
Member Avatar for Gotoma

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 …

Member Avatar for aashi.bajwa.9
0
10K
Member Avatar for BogdanCov

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?

Member Avatar for c0d3rH4ck
0
5K
Member Avatar for Benjamin_10

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 …

Member Avatar for Hiroshe
0
4K
Member Avatar for Brennan_1

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 …

Member Avatar for Hiroshe
0
266
Member Avatar for kickbass6

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 …

Member Avatar for vmanes
0
5K
Member Avatar for asia_6969

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

Member Avatar for Ancient Dragon
0
389
Member Avatar for shumaila akbar

what is cin>> nd cout<<.whats the purpose of these in c++ or programming???

Member Avatar for Vikram Sehgal
0
152
Member Avatar for Vikram Sehgal

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 …

Member Avatar for Vikram Sehgal
0
2K
Member Avatar for masimba81

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

Member Avatar for richieking
0
129
Member Avatar for Dan_2

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 …

0
91
Member Avatar for mahdi.almansour

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 …

Member Avatar for Felix Arba
0
106
Member Avatar for phony

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 …

Member Avatar for nullptr
0
319
Member Avatar for jkhippie

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

Member Avatar for jkhippie
0
2K
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 pdk123
0
250
Member Avatar for JOLO14

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 …

Member Avatar for NathanOliver
0
174
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
386
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

The End.