- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
8 Posted Topics
so im trying to build a connect 4 gameboard using charecter arrays and it has to look like this O | O | O | O ------------- O | O | O | O ------------- O | O | O | O ------------- O | O | O | O … | |
The problem for my CMPT103 class is to write a program that takes a binary number as an integer and returns it as a decimal, i would be able to do this easily by taking it as a charecter array and dealing with each individual element but i dont understand … | |
[CODE]int userChoice(){ int choice; cin>> choice; while (choice!=1 && choice!=2){ cout<<"that is not a valid choice please choose again "; cin>>choice;} return choice; }[/CODE] the whole point of this is that if a user doesnt enter 1 or 2 then it tells them to enter 1 or 2 and wont … | |
first off i apologize for my ignorance but i cant seem to find a clear answer to this question, if i have a function with variables in it, do those variables reset every time i call the function for example if i write code to build a game and then … | |
[CODE]// ---------------------------------------------- // Name: William Rennie // Program: // Description: // ---------------------------------------------- #include <iostream> #include <cstdlib> #include <stdio.h> #include <string.h> using namespace std; // ----------- Function definitions ------------- void printTitle(int gamenumber){ gamenumber++; cout<<"***Word guessing game round "<<gamenumber;} bool checkWord(char word[],char guess[]){ int i; int x=strcmp(word,guess); if (x==0){return true;} else return … | |
I was wondering whats the simplest way to count and sort the elements of each array when using a set like [CODE]char list[40][30];[/CODE] theyre being brought in from a text file that would simply look something like this apples bannanas oranges grapes i would need to count each element, sort … | |
Im supposed to write a program that reads in 10 c strings and will sort them alphabetically using (strcmp(list[h],list[j])>0) which basically says if list h is closer to the start of the alphabet then it is true else it is false here is my code [CODE]#include <iostream> #include <cstdlib> using … | |
so for my computing project we have just started to work with using input and output of text files, the tutorial my teacher gave said to include these libraries, which i did [CODE]#inclue <fstream> #include <iomanip>[/CODE] and explains how to use [CODE] ifstream fin; //fin is my file input variable … |
The End.