- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
10 Posted Topics
i have done coding for the board but now I'm stuck on getting randomizing ship placement for player1 and player2 So far for ship placement all i have is the function prototype. [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> int placeship( int x, int z[ ][ 10 ] ); // function[/CODE] … | |
btw this is a part of a battleship code i want to know what the integers a,b,c,d,e,f... do I know this has something to do with placing ships randomly but it is a little complexed for me. I'd appreciate it if someone took their time to explain it [CODE]int placeship( … | |
btw this is a part of a battleship code i want to know what the integers a,b,c,d,e,f... do I know this has something to do with placing ships randomly but it is a little complexed for me. I'd appreciate it if someone took their time to explain it [CODE]int placeship( … | |
[CODE]string rev; for(int i =1; i<=(int)user.length();i+=2) { rev = user.length[i+1]; rev = user.length[i]; } [/CODE] this is a part of my code where "user" is the user inputted text. I'm trying to get the output to do this. input - square output - er au qs I've been stuck on … | |
I'm trying to reverse a string in pairs Example: input - heaven output - ne va eh My code seems to be right until the last for loop... That's where I need help Here's my code: [CODE]#include <iostream> #include <string> using namespace std; string revString(string user); int main() { string … | |
I can reverse it but can't figure out how to reverse it in pairs. example - hello output - ol le h [CODE]#include <iostream> #include <string> using namespace std; int main() { string user; cout<<"Enter a random text"<<endl; getline(cin,user); for(int i = user.length();i>=0;i--) { cout<<user[i]; } return 0; } [/CODE] | |
I know this program only takes few lines. I don't now how to out put the text to print every other letter for example: shsofwbanrqeiyzobu output: h o w a r e y o u [CODE]int main() {string k; cout << "eneter a text" << endl; getline(cin,k); for(int index =1; … | |
My teacher showed me something like this with functions but I don't quiet get it. Since, I can't ask him right now...I came here for help. I'm suppose to write a function to display days in a month. This is my first time using functions so all the help I … | |
Hello, basically I'm trying to write a program where you ask the user to input 2 positive number. Then the program will print the lower of the two numbers to the higher of the 2 numbers and then higher of the 2 numbers to the lower of the 2 numbers. … | |
Hello, basically I'm trying to write a program where you ask the user to input 2 positive number. Then the program will print the lower of the two numbers to the higher of the 2 numbers and then higher of the 2 numbers to the lower of the 2 numbers. … |
The End.