49,761 Topics
| |
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; public class MatrixPath { static List<String[]> obstacles = new ArrayList<String[]>(); static String[] size = new String[2]; static String[] startingPoint = new String[2]; static String[] endPoint = new String[2]; static int sizeOfRow = 0,sizeOfCol = 0; char one = ' '; … | |
I am trying to create a header file that contains several global variables. At the moment, the Globals header file looks like this: This is Globals.h #ifndef GLOBALS_INCLUDED #define GLOBALS_INCLUDED #include <string> std::string DRIVE="HELLO!!!!!"; #endif To go along with this, I have a cpp and h file the contain a … | |
G'day everyone! I'm fairly new to C++, so bear with me if this is painfully obvious. I'm trying to get a user to guess a string, which is just a vector containing random capital letters. That random letters part works great, however I can't figure out how to get my … | |
I want to my program to prompt user to input a number with three or more integers I need the program to output a space between each numebr example: cin>>3334; i want the output to show 3 3 3 4 each with a space and then i also need to … | |
Write a C++ program that takes in text from the user and prints the total Number of spaces used in the text. Kindly, use #include<iostream> and #include<conio.h> only. while loop is more preferable than for or do-while. | |
how can i make toupper global so that all variable in char will be all upper? | |
#include <iostream> using namespace std; int main() { int passwoard; cout << "enter ur passs...."; cin >> passwoard; return 0; } if(passwoard == 100) cout << "i loveu "; | |
Hi, I am not able to destroy a hash table. I have put the destroy function below: void desTable(ListNode* v[10]) { ListNode* temp; ListNode* tempNext; for (int i = 0; i < 10; i++) { if (NULL != v[10]) { temp = v[10]; while (NULL != temp) { tempNext = … | |
long waitingTime(vector<int> tickets, int p) { // bool flag indicates whether it's Jesse or not queue<pair<int, bool> > aQueue; for(int i = 0; i < tickets.size(); i++) { aQueue.push(make_pair(tickets[i], i == p)); } long long nTime = 1; while(!aQueue.empty()) { pair<int, bool> aItem = aQueue.front(); aQueue.pop(); nTime++; if(aItem.first == 1 … | |
Well inside the windows operating system there are predefinided dialog boxes. We can use it freely with little effort. Think that you have to get a input file name or file path. The traditional way of doing this is parsing the command line arguments.But here we are in win32 , … | |
Hi, I'm trying to make a program that sets up the hight dpi compatibility mode programatically on Windows 10, so that I don't have to set up manually the properties of every legacy *.exe program I use, there are hundreds. When you set up that on a local drive, Windows … | |
I wrote an application using pthreads which had 5 threads. 4 of the threads filled up 4 buffers and once they had been filled the main thread would be combine these together. This was achieve using barrier so the main thread would wait until the 4 worker threads had reached … | |
#include<iostream.h> void main() { int a,b,r; cout<<"a=";cin>>a; cout<<"b=";cin>>b; while (r!=0) { r=a%b; a=b; b=r;} cout<<"cmmdc="<<a; | |
OK, so I've learned through Google search that MinGW does not handle random number generation very well. Even when using a random generator seed based upon the time, it creates the same random numbers each time the program is run. This happens whether we used the old style rand, or … | |
Hello, Please I want to get an input of string, like mm/dd/yyyy hh/mm/ss where first mm is month,.... and second mm is minutes.... then want to split each into date object.. like ... month day year.... after each / .... I am lost here... thanks istream &operator>>(istream& inputStream, Date& dateObject) … | |
So i'm in the process of learning about functions and I'm not grasping the full operation of them. I have a menu in which I have utilized a function but I want to create a fucntion for each of the menu options. I've heard of pointers but I haven't researched … | |
class space { public static void main(String args[]) { int i; for(i=0;i<5;i++) { System.out.print("*"); System.out.print("_"); } } for(i=0;i<5;i++) { System.out.println("*"); } } | |
Hi people, I am currently teaching myself C++ with Stroustrup's "Programming, Principles and Practice using C++" and I'm stuck on one of the in-book exercises. It is a chunk of code (~180 lines) of buggy code that, when debugged properly, should create a calculator program. I have reached the limits … | |
Hello everyone, We're trying to create a new open-source app distribution platform named Spheris, using blockchain technology. We are really interested in your thoughts – both devs and users. We're also open for possible collabs for those who are interested. We’re utilizing Ethereum’s blockchain technology to build Spheris as a … | |
Hi good day.. i need your help with my exercises.. i need to know how to compute the cents.. in any given amount.. in denominations.. for C programming Thanks.. Given amount : 1886.25 if (amount>=1000) x = amount / 1000; amount % 1000; printf("%d",&x); Answer is : 1 but for … | |
I am trying to learn error trapping using the C++ commands try, throw, and catch. The problem I seem to be encountering is when I use new to declare an array. When the program throws an exception, don't I need to delete those arrays to prevent a memory leak? I … | |
This problem is to print a square using a number that the user enters, which would be in the center. If the user entered a 5, then the program should output this: 111111111 122222221 123333321 123444321 123454321 123444321 123333321 122222221 111111111 If you're wondering, this was not a homework assignment. … | |
Hi Guys. I'm not a c++ dev but a VB.NET developer. I will first explain my scenario so that the question would be clear. Suppose I had a form which has a Label contro named label1 and the project name is Test which is done in a Visual Studio using … | |
Hi DW. Is there anyone know how to read a text file line by line from the web/internet in VC++? I have a function which works well in reading the local file but its seems as if its doesn't find or read a file on a web server. A file … | |
I'm coding a program to learn OpenGL in C++ (based off of The Benny Boxes tutorials) and I've run into a snag where I don't get any errors, but my shaders refuse to apply to the triangle that I'm rendering. I'm going to give you all the relevant code but … | |
hello i am a newbi c++ user.it will be great if someone can help me write a password protected program for multiple user where the user can change the password .it would be better if the program could show the strenght of password,like its strong or weak password. | |
This is a remake of the Simple Equation Solver snippet that is written in Java. This is an equivalent version written in C++. | |
Hi, I have written a code for Roman Numeral basic mathematical operation in C++. How to do unit testing for it/ How to write unit testing program for it? Here is the code: #include <iostream> #include <string> using namespace std; //Function to convert decimal number to roman string decimal_to_Roman(int number) … | |
C++ function that input any of 0-35 numbers, and if input from 0-9 the output are its specific number and if input 10-35 this is the output: 10=A; 11=B; 12=C; 13=D; 14=E; 15=F; 16=G; 17=H; 18=I; 19=J;...35=Z. If possible without using an array. |
The End.