49,761 Topics

Member Avatar for
Member Avatar for shelton22

Hi Friends! I have tried to find all possible paths between two nodes; #include <iostream> #include <vector> #include <queue> #include <map> #include "fstream" #define max_edges 16 #define MAX_NODES 5 using namespace std; bool isadjacency_node_not_present_in_current_path(int node,vector<int>pathway); int findpaths(int source ,int target ); void display_all_paths_map(); vector<vector<int> >GRAPH(100); vector<int>pathway; map<int,vector<int>> allpathsmap; map<int,vector<int>>:: iterator …

0
213
Member Avatar for smitsky

Hi. I'm getting the following message when I try to overload operator= here in line 830-833. I have also included the error messages. Thanks #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> #include <cstdlib> using namespace std; /** * Global Variables */ string k; int pmem, plen; int …

Member Avatar for uonsin
0
346
Member Avatar for shelton22

Hi Friends, I have a graph in text file (origin, destin, link_id) such as 1 2 1 1 3 2 1 5 3 2 1 4 2 3 5 2 4 6 2 5 7 3 1 8 3 2 9 3 4 10 4 2 11 4 3 12 …

Member Avatar for Slavi
0
245
Member Avatar for Ahmed_52

7) Write an implementation of this class using the C++ language. (i.e. implementation of the abstract class and all of its functions definition) a. Class label: MyClass b. Private members: int y, int array[10] c. Public members: void sety(int a); int gety(); void set_array(int a[], int size); MyClass(); MyClass(int a, …

Member Avatar for Benard joseph
-3
145
Member Avatar for shelton22

Can any one convert this Java code to c++? import java.util.*; import java.io.*; public class Test { private static HashMap<String, List<String>> left_map_rights; public static void main(String args[]) throws Exception { left_map_rights = new HashMap<>(); BufferedReader r = new BufferedReader(new FileReader("routes.text")); String line; HashMap<String, Void> lines = new HashMap<>(); while ((line …

Member Avatar for Hiroshe
0
384
Member Avatar for wrda

Write the following functions: Main: declare an array of size 7 with random numbers, call the following functions. * PrintArray: prints the elements of the array. * SumArray: Return the sum of elements of the array.

Member Avatar for Slavi
-2
143
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
131
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
925
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
423
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
268
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
391
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

The End.