49,761 Topics

Member Avatar for
Member Avatar for Sajjad_4

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

Member Avatar for JamesCherrill
0
454
Member Avatar for Thomas_36

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 …

0
142
Member Avatar for luke_8

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 …

Member Avatar for David W
0
1K
Member Avatar for jomon_1
Member Avatar for stefy14

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 …

Member Avatar for amisha_1
0
57K
Member Avatar for MUHAMMAD AHMAD_1

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.

Member Avatar for Reverend Jim
0
347
Member Avatar for heo

how can i make toupper global so that all variable in char will be all upper?

Member Avatar for DavidB
0
150
Member Avatar for harsha_6

#include <iostream> using namespace std; int main() { int passwoard; cout << "enter ur passs...."; cin >> passwoard; return 0; } if(passwoard == 100) cout << "i loveu ";

Member Avatar for DavidB
0
162
Member Avatar for kay_1

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

Member Avatar for jkon
0
447
Member Avatar for Ade Ihsan

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 …

Member Avatar for rproffitt
0
1K
Member Avatar for NicAx64

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

Member Avatar for Y_2
0
19K
Member Avatar for Robert_66

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 …

Member Avatar for rproffitt
0
1K
Member Avatar for Sarlacc

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 …

Member Avatar for Ben_27
0
7K
Member Avatar for Busuioc

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

Member Avatar for pty
-1
230
Member Avatar for Thomas_36

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 …

Member Avatar for rubberman
0
988
Member Avatar for jnneson

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

Member Avatar for jnneson
0
286
Member Avatar for Chris_45

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 …

Member Avatar for Joris Claassen
0
374
Member Avatar for GURPREET_6

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("*"); } }

Member Avatar for Joris Claassen
0
401
Member Avatar for Member 785072

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 …

Member Avatar for Matic_1
0
974
Member Avatar for Spheris

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 …

Member Avatar for Spheris
0
201
Member Avatar for Joe_32

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 …

Member Avatar for thines01
0
397
Member Avatar for Thomas_36

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 …

Member Avatar for Thomas_36
0
369
Member Avatar for rfrapp

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

Member Avatar for pty
0
1K
Member Avatar for Mr.M

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 …

Member Avatar for Mr.M
0
324
Member Avatar for Mr.M

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 …

Member Avatar for thines01
0
3K
Member Avatar for Nether_1

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 …

Member Avatar for wrathness
0
533
Member Avatar for ramisa_1

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.

Member Avatar for rproffitt
0
275
Member Avatar for Alex Edwards

This is a remake of the Simple Equation Solver snippet that is written in Java. This is an equivalent version written in C++.

Member Avatar for hassan_24
1
8K
Member Avatar for shadab96

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

Member Avatar for AssertNull
0
1K
Member Avatar for sprikot

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.

Member Avatar for Reverend Jim
0
97

The End.