49,761 Topics
| |
Good day everyone! I have the codes for such a problem where, to create a program that counts how many times the second string appears on the first string. Here it is: #include <iostream> #include <conio.h> using namespace std; int main () { char first [100], second; int count; cout … | |
How can I make a textile in a FLTK executable in main(), so when opening the program, and put text in it? The standard way via ofstream does not work now. The code I want to elaborate on is on this website: http://www.fltk.org/strfiles/267/fltk_input.cpp Now when I add ofstream myfile; myfile.open … | |
Hey, I allowed to use only one getter and setter per class. My variables initialization in the calss in need them is correct (I used the Debagger) But then I can not access the private variables ... Here is part of the program.. #ifndef _H_SIMULATION #define _H_SIMULATION #include <iostream> using … | |
Hi, The sqrt function does not accept integers of type `unsigned long long int`. Is there a pre-exisiting C++/C standard function that can compute square roots of integers of that size? Thanks in advance, Caelan. | |
This is the first time I have felt a smidgen of fear when learning C++. I am doing an exercise in *Accelerated C++* and the fear is that I'm not appropriately handling memory. I'll list my code below but I figured I would give some specific questions first: 1. Is … | |
I've been having a hard time for quite a while now trying to read files. These files include English text, pictures music and so on. After hurting in the jungles of Africa or the internet I found something that worked. `string str((istreambuf_iterator<char>(fileIn)), istreambuf_iterator<char>());` This made it possible to do all … | |
Hello, please help segmentation of a picture in color using Builder C++ -Level set or - Growing region or - Watershead. | |
Create a two & three -Dimensional Shapes Mini-system that consists of 6 shapes, Square, Rectangle, Triangle, Circle, Cube and Sphere and then calculate area, perimeter, volume , or draw the shape. After that, it does the following tasks: 1. The code ask the user to enter the required values should … | |
#include<iostream.h> #include<stdio.h> char A[3][3]={1,2,3, 4,5,6, 7,8,9}; void printmaze(); void makemove(int,int); void checkmove1(int,int); void checkmove(); void checkrow(); void checkcol(); void checkdiag1(); void checkdiag2(); void makealtmove(); void result(); int main() { int m11,m12,m21,m22,m31,m32,m41,m42,m51,m52; char ch; do { cout<<"Welcome to tic-tac-toe"<<endl; printmaze(); cout<<"for choosing 1--> input 0 0, 2-->0 1, 3-->0 2 \n … | |
Hi, I wrote this implementation of Sieve of Eratosthenes, is there any way I could eek some more performance out of it. As in opitmising data types, calculations etc. #include <iostream> // cout #include <math.h> // sqrt #include <time.h> // clock/CLOCKS_PER_SEC #include <stdlib.h> // malloc/free using namespace std; int main(int … | |
Hello fellow coders, I am currently taking a C++ class and have a final project due very soon. We are recreating the game Othello/Reversi using the console. So far I haven't run into really any problems and it hasn't been too bad. I have almost all of it complete except … | |
OK down below where my IDM button is under WM_COMMAND: is my checkbox processing body. Under WM_CREATE is the checkbox being created. The problem is my application always starts with the check box checked, and will NOT let me uncheck it with the mouse. Please help would be great! /********************************************************************/ … | |
Can someone please tell me why when I check one of my boxes, and click the button I get no message box in accordance to which checkbox I checked. #include <windows.h> #include <dos.h> #include <stdlib.h> #include <fstream> using namespace std; #define IDC_MAIN_BUTTON 101 // Button identifier #define IDC_MAIN_EDIT 102 // … | |
Hello, I posted on this forum two times before about a particular pair of non-printing characters being inserted into my code. You can find the threads [here](https://www.daniweb.com/software-development/threads/441611/stray-non-printing-characters-in-my-programs) and [here](https://www.daniweb.com/software-development/cpp/threads/450296/arbitrarily-appearing-non-printing-character). Two great posters tried their best to solve this problem (mike_2000_17 and deceptikon) to no avail. Finally, using the hints that … | |
Problem Your task is to write a program that plays the game of life. This game is a computer simulation of the life and death events in a population of single-cell organisms. Each position in a two-dimensional grid (Petri dish) can support one cell. The program determines whether each position … | |
Hey, I would like to break one char for example "t6" into to chars t and 6 look at what i did... int a,b; temp = *arraystr[2] % '10'; a = temp - '0'; temp = *arraystr[2] / '10'; b = temp - 'a'; | |
Could someone please tell me how I can run my C++ code using Command prompt? How should I open it, and what I need to write? And if there are more than one text files in my code including input data, how I can choose one of them to run … | |
Reading Stroustrup: Programming -- Principles and Practice Using C++, chapter 4, exercise 4: "Write a program to play a numbers guessing game. The user thinks of a number between 1 and 100 and your program asks questions to figure out what the number is (e.g., "Is the number you are … | |
i want to build program that recive (c code in txt file) then searching for words (int , double, char, float) and count number of vaiables appear according to that. then store the variables in array (e.g. int x; i want to store X in array and so on). i … | |
Hi all I have a qt application in which I have a QTreewidget that displays some content in the QTextBrowser. I set the contents for the html document in the textbrowser using the setHtml() function. All I want now is to fetch the url of this html document so that … | |
//BlackJack // Plays a simple version of the casino style game of blackjack; 1 - 7 players #include <iostream> #include <string> #include <vector> #include <algorithm> #include <ctime> using namespace std; class Card { public: enum rank {ACE = 1, TWO , THREE , FOUR , FIVE , SIX , SEVEN … | |
Can someone help? This is an assignment on a game I supposed to do. But I have plenty more to do. WRITE A PROGRAMMING TO LET A USER STICK TO THE BOLD. LET A BOARD CONTENT 3 LAYERS. A USER WILL TRY TO SPIN RANDOM VALUE BETWEEN 0 TO 1 … | |
| Umm my code doesn't work properly and I don't seem to find the solution for my problem. Code doesn't print the right numbers. Can anybody help? Thank you! #include <iostream> #include <conio.h> using namespace std; main(){ int number[] = {3, 5, 8, 1, 9, 2, 6, 4, 7, 10}; int … |
MACHINE PROBLEM NUMBER 3 ROTATING SENTENCES Input File: rotate.txt In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program will display them from top to bottom and … | |
Write a program that reads a sentence as input and converts each word to “Pig Latin.” To convert an English word to Pig Latin, you remove the first letter and place that letter at the end of the word. Then you append the string “ay” to the word. Here is … | |
hi everyone :) I want a new questions on Hash functions and graphs >>like what process can we do on it !! any code ideas ? because I have an exam (data structure) so I want to study new ideas thanks ^_^ | |
Hi there, I learn C++ on internet because my gymnasium wont do it now so by searching on google i saw some topics similar with this but they weren't what I was looking for. Can i make a square on C++ using no stars or loops or anything similar? I … |
The End.