Beginners - December 2019 (Page 4)

What is a Header file/ how to use it
 
I'm kinda new to C++ and i always programmed without header files but i heard header files are really important but i don't know what that is / how to use it. C...
[2 replies] Last: additional info: http://freesourcec.com/how-does-include-work/ (by kakaducsy)
Looking to Loop A menu
 
So I've searched all over but I can't seem to find any help on how to loop menus a specific way. I know this question has been asked a million times, but I can'...
[3 replies] Last: @jonnin and @repeater, thank you! I figured a do/Whle would be the bes... (by jamiprogrammer)
When You First Started
 
I have a quite simple question. When you started to learn how to program in general, how did you decide what projects to work on to reinforce what it is that...
[13 replies] Last: MasterDak, I was about to post almost this same question yesterday. I... (by failedreality)
Interface vs Class Declarations
 
Hi all, I was hoping to get some clarification on a piece of conceptual understanding I've been scratching my head about over the last few days. It concerns...
[12 replies] Last: Wouldn't the pImpl pattern achieve the same thing more easily? Yes. ... (by jonnin)
Solving car fueling problem
 
I am trying to solve the car fueling problem. The problem sounds like this: You are going to travel to another city that is located 𝑑 miles away from you...
[4 replies] Last: Thank you. Yes, I was wondering how I could overcome this issue with t... (by marialavr)
Removing any element on a list
 
I want to add a remove feature by accessing any part of the list. for example: I added 3 names Mark Max May I want to remove it by searching the name it...
[11 replies] Last: PS Instead of the iterator being 'show' maybe 'name_in_list' might add... (by againtry)
Need some help! :')
 
How do i make nested loop to create these numbers? 10 11 13 16 20 25 Please help me, thanks!
[14 replies] Last: For god's sake lastchance, you even took the time and effort x') Bless (by H00G0)
Making a calculator
 
So i'm trying to figure a way to call back to a place in a vector (labelled history) but backwards. It's hard to explain for me. Basically i'm making a calculat...
[8 replies] Last: Be grateful your instructor/school uses DevC++. There are programmin... (by George P)
by ICantC
Printing template types
 
My usual overload for operator << doesn't seem to be working with templates, no matter what type I put in, I get some weird hex and have tried several methods a...
[1 reply] : Try putting a print statement in your operator<<, see if it prints. P... (by Ganado)
populate two-dimensional array with two one-dimensional arrays
 
I'm having a hard time working out how to approach this, and I didn't find anything on web or forum searches that helped. I have two one-dimensional arrays...
[3 replies] Last: I got it figured out. I just needed a nudge. Thank you! (by closed account 1Ck93TCk)
by seatea
Possible to merge strings in an order of your chosing?
 
Hi! Let's consider having two strings: string example1 = "A3B3C3DEF3G" string example2 = "HIJKLMN" Is it possible to merge these but leave the...
[1 reply] : loop over string calling a transform() that calls your lambda that may... (by jonnin)
SOS I couldn't stop the loop in TIC TAC TOE game
 
How to stop the loop? It keep repeating itself #include <stdio.h> #include <stdlib.h> int b ; /* board. 0: blank; -1: computer; 1: human */ //winning patt...
[3 replies] Last: change while (1) printf("%s", game(first = !first)); to char yn = 0; ... (by jonnin)
by blobbb
How do I get this to print only the integer solutions?
 
If I wanted to adjust my code so that only integer solutions of x and i are displayed, how would I do that? For example, if x is 2 then x should be displayed al...
[2 replies] Last: as a side note, loops with a double loop variable have risks of not do... (by jonnin)
Pointer to array of character in C++
 
Hello, I want to declare a pointer to an array of characters in C++. How can I do it? #include <iostream> int main() { char letter ; /...
[7 replies] Last: you don't need an explicit pointer to do C on it. sprintf(letter, "%s... (by jonnin)
Sequence of Chars in C
 
Hello, I want to allocate memory with pointer and get string from user. I don't want to use an array. I have the below error. Exception thrown at 0x7BD...
[13 replies] Last: new/delete is c++ malloc/free is C you cannot delete where you used m... (by jonnin)
Detecting Enter and ESC in C++ with ASCII code
 
Hello, How can I detecting Enter and ESC in C++ with ASCII code? I put one breakpoint in the (int)ch != 27 When I press enter key I saw char is 3 instea...
[1 reply] : 'enter' varies by system, its a mix of 10 and 13 ascii codes (or both,... (by jonnin)
accessing an object from a vector
 
How would I be able to access x or y variables from the octagons vector after storing the object. I know how I'd access x and y from the lots_of_coordinates ve...
[6 replies] Last: Why do you want vector of pointers? with octagons.push_back(new Octa... (by keskiverto)
by liayag
How to index vectors with data stored in a text file.
 
I have a text file that has information about different cars. 1 2019 Honda Civic Sedan 23000 2 2019 Honda Pilot SUV 32000 3 2019 Honda Odyssey Sedan 27000 I wa...
[7 replies] Last: This definitely helped a lot. Thank you so much!! (by liayag)
by iOsama
Calendar functions
 
i need someone to explain these functions to me, What do these functions do! void leafCalendar(int inputYear, int inputMonth) { i...
[2 replies] Last: The best way to understand stuff like this is to write it yourself ... (by Duthomhas)
Stack + Template
 
I've been trying to create a system where you can enter in the student name(will do the name later)and grades for each class, but I'm having trouble with displa...
[4 replies] Last: answer is spelled wrong consistently. As long as every instance of t... (by George P)
December 2019 Pages: 123456... 13
  Archived months: [nov2019] [jan2020]

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