Beginners - December 2018 (Page 13)

Array + Function (Void functions and sum)
 
Task: 1. Build the function f(x) that creates an array according to formula: Ai=(i+1)/(x)*(-1)^i 2. Use the function to build the array B with size 150 3. Displ...
[2 replies] Last: Thank you so much my friend. It works and I will study what you sent m... (by polishprogrammer88)
Output numbers in reverse HELP
 
Hello, So I need to write a code that will output numbers in reverse. Which I plan to read into a vector. Here is my code: #include <iostream> #include <...
[2 replies] Last: Yes thank you ( I'm personally still having trouble with functions). S... (by Marcos8701)
Mastermind COde
 
I am unsure on how to fill out the rest of the code. I need arrays for the number of tries and spots. #include <iostream> #include <cstdlib> #include <t...
[10 replies] Last: can you open your pms (by YeetParadox)
Print even numbers between two integers
 
Hi, What's the easiest way to print all even numbers between two ints? I know it would be a while loop, but I'm not sure how to achieve it. Thanks
[5 replies] Last: I got it thank you I was looking at the wrong section on the link (by glasseater)
Random card from shuffle
 
How can I get a random card from a pack of cards. I have tried to write a shuffle using the srand but it gives me a random number followed by a letter, like 007...
[2 replies] Last: Using C++11 constructs to create a 52 card deck, display it, shuffle i... (by closed account E0p9LyTq)
Function
 
Help in writing a function that checks from a string the the following: Binary, Hex and Decimal. bool is bin(String,num){ return is binary } bool is...
[5 replies] Last: Thousand Thanks @ Handy Andy (2439) and jonnin (3612). Bravo!! (by scott14)
Trying to make a game (need help)
 
Alright, so I'm trying to make a simple brief choice based text game for my final assignment (Yep, finals week for me. Woohoo...) However, I could use assistanc...
[4 replies] Last: Thank you. (by AnotherAmateur)
Splitting Linked List at a given node into two sublists
 
Hello, I am in need of some help with this problem given to me here. I don't even know where to start, so if someone could help me get the ball rolling that wou...
[6 replies] Last: while ( foo = bar); //granted the compiler will warn but this is the i... (by jonnin)
If statement replacement
 
Hello. In games, I notice the need for a large number of if and else if statements. Are there any alternatives?
[7 replies] Last: Thank you. (by Ganado)
How to pass an iterable as a function parameter?
 
Hello, I have a 'join'-function that joins an array's elements to a string. This is what I want: vector<int> a = {1,2,3} array<int, 3> b = {1,2,3} cou...
[1 reply] : #include <iostream> #include <sstream> #include <string> #include <ve... (by lastchance)
by KHFrak
Help with Lab?
 
So I understand the point of void functions and functions in general but my professor assigned a lab that I am completely lost in, I missed around two weeks of ...
[2 replies] Last: for (int j = 0; j < stars; j++) { cout << "*"; } You're sup... (by salem c)
Passenger Seat issues
 
Im working on a program that will let you reserve plane seats and most of its working fine, except it won't mention if there's an invalid input or if a seat's a...
[5 replies] Last: Sorry for the late reply. And why did you delete the invalid message... (by coder777)
When to use unique_ptr
 
Hello. I have recently learned about unique_ptr and I wonder when I should use it over the original way (Deleting them yourself).
[1 reply] : You should use unique_ptr when writing the component that would othe... (by mbozzi)
Regex
 
Write your question here. Need help with regex statement to recognise: 1. Binary numbers only. 2. Hexa decimal numbers only
[7 replies] Last: Hello....I am a new member in this forum site...I have no idea in this... (by certvalue143)
error C2679 overloaded function?
 
I am new to programming and I am getting an error that I cant track down. im sure that by problem stems from lack of experience but I think the error has to do ...
[4 replies] Last: Thank you fro your help everyone I was just missing parentheses on the... (by PermThesis)
SDL_Rect rendering the full size of the screen
 
hey guys, I feel this question is too basic to put in anything other than the beginners section, anyway I'm trying to draw a button(SDL_Rect) to the windo...
[6 replies] Last: lol like I have said you are a better programmer no doubt,but honestly... (by adam2016)
by yat89
Reading text file into array
 
Hi everyone. I new to c++ programming. I would like to ask regarding reading an array from text file. Given an input data as follows: Input data (in .txt): 0 ...
[3 replies] Last: So, do you know about std::stringstream and you don’t know about 2D ... (by Enoizat)
Last element in an array...
 
The task: 1. Create an array "pipes_thickness" with size 200 2. Assign a random value for every element of the array (range: 1-10) 3. Input a value "thicknes...
[4 replies] Last: Also, your code skips the first element of the array. That's a mistake... (by Repeater)
how many times each word was seen
 
Hi, Im trying to write a program that I put 2 input files with some words in each one ,convert them into the array, then my program should decide how many time...
[5 replies] Last: I haven’t written the code, but it could be something like this: #... (by Enoizat)
by Drac0
Confusions with structures (1,2)
 
I am writing a program that will automate a diner, so have the user order as many items as they want and they with that information it will print a receipt and ...
[24 replies] Last: my counsel crashes everytime i run the program, even with this code, w... (by Drac0)
December 2018 Pages: 1... 1112131415... 22
  Archived months: [nov2018] [jan2019]

This is an archived page. To post a new message, go to the current page.