Beginners - May 2021

by CVRIV
I have some questions about reading/writing to/from a file.
 
I've been reading up on this subject but can't seem to find anything specific about a few things I'm wondering about. #1. Should I check if a file is open an...
[3 replies] Last: Awesome. Thanks. (by CVRIV)
Newbie in c++ Some one help me with this.
 
I am having trouble in pointers 1. Consider the given function; void set(int *ptr) { *ptr = 180; } Show how to call the set function so that it set...
[3 replies] Last: https://www.learncpp.com/cpp-tutorial/introduction-to-pointers/ (by George P)
by Zetrox
new c++ learner , could u help me please
 
Hello everyone i have this exercise where i have to fill up a quizz of 30 question , i answered all the questions but im still struggling with this one , i know...
[4 replies] Last: many, many compilers accept D as OK if not set to be very strict. You... (by jonnin)
by VDNS
Station problem c++
 
I need help with the next problem. Correct the next issue so that it runs. Or any other solution :) #include using namespace std; #define N 101 struct st...
[3 replies] Last: #include <iostream> #include <fstream> #include <vector> using namesp... (by lastchance)
by Ch1156
How to copy a classes constructor arguments in derived class without retyping them all?
 
So lets say I have a base class and the constructor for it has 10 arguments, If I inherit from that class I need to retype all the base classes constructor argu...
[5 replies] Last: Ok thank you for explaining. Is there ever a time where using #1 is a ... (by Ch1156)
Aggregation. Trying to establish connection between objects of two different classes
 
Hello! I've created one vector for the drivers class and one for the buses class. The atributes of all the elements are read from the files. Now I'm trying to...
[6 replies] Last: Try not to write code that doesn't serve any essential purpose. Use t... (by mbozzi)
converting CURL command line to libcurl code
 
Hi I can successfully POST data using the libcurl utility: curl -v -X POST -d "{\"temperature\": 25}" http://localhost:8080/api/v1/MY_ACCESS_TOKEN/tele...
[1 reply] : Try adding a / at the end of HOST_SUFFIX #define HOST_SUFFIX "/tele... (by dutch)
Question regarding the language
 
I just want to know , when you code , do you still look up some phrases or do you do it all out of your head? for example , if you were to write a program th...
[4 replies] Last: It is often helpful to remember that optional args are on the right. T... (by seeplus)
vs19 c++ console app LINK : warning LNK4067
 
I am getting below error when I want to Build and Release my app: LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup' This is how my mai...
[2 replies] Last: Other than main.cpp, project file only consist of one header file "def... (by hdcpp64)
How to do insertion sort using 2 arrays..(storing the sorted array in another array)
 
Hi,im currently trying to do insertion sort using 2 array and I've tried insertion sort using 1 array. The main idea for insertion sort using 2 array is to have...
[4 replies] Last: Yes!! @markyrocks thats exactly what im looking for..Thank you so much... (by lindsayy)
by Zetrox
Am new to c++ and programming in general , can you please hep me with this exercise?
 
i have this exercise where i have to find the error in some code and correct it in some cases , i already did what i managed to figure out by myself but i still...
[7 replies] Last: the search function can be much easier: int search(int ar , int size,... (by anup30)
by CVRIV
Help with using a type alias with a custom class. Please.
 
I think I answered my own question during the time it took me to write this out, but I want to make sure I'm right. I left the subject the same even though I co...
[6 replies] Last: yes do what Seeplus said, emplace back. I always forget the name of i... (by jonnin)
Converting from C++ to C
 
Hi, I'm working on a project, and below is a segment of my code written in C++. However, it's required in C, but I don't know how to write the counterpart of it...
[9 replies] Last: Another alternative to possibly simply the code is to process the file... (by seeplus)
linked list, big O
 
I am learning linked list, some sites are saying that insertion and deletion are O(1) and others are saying O(n). I understood why it is saying O(n) because It ...
[3 replies] Last: do interviewers still ask this stuff frequently? Yes - but usually ... (by seeplus)
Having trouble outputting from a file
 
I'm using a playfair program, and i'm having trouble with outputting to my file. Everything outputs correctly, minus the encryption of my text file. the "me...
[2 replies] Last: In function search(), if p isn't found there's nothing returned - but ... (by seeplus)
Learning loops
 
How do I make multiples of three or five to be printed? ------------------------------------------------------------------------------------------------------ ...
[2 replies] Last: Thank you seeplus! (by normantseu)
Refernce variable length array with pointer
 
project description: I have an esp8266 that is receiving a string representing a color pattern of rgb values with a time for transitioning to the next color. ex...
[2 replies] Last: The easiest c++ way probably is to use istringstream and getline() as ... (by seeplus)
by Ch1156
Inheriting from a base class that inherits from another base class (1,2)
 
Im reading through C++ Primer 5th edition and I got to chapter 15 about object oriented programming and virtual, so i decided to try to do it myself, and I had ...
[25 replies] Last: unique_ptr< Fighter > fighter = make_unique< F35Lightening2 >("F-35 L... (by againtry)
REPETITION
 
1) Write a program in C++ that is capable of displaying how many numbers from 0 to 100 that are divisible by 2 and 5. 2) Write a program in C++ that is able ...
[9 replies] Last: void re(int n,int cnt=0) { if (n > 100) { cout << "count= " << cnt;... (by markyrocks)
returning value using a pointer and struct
 
I'm trying to have my function return the current position of the person but I'm having trouble figuring out the proper way to return the value because it's a p...
[2 replies] Last: this all seems to be working right. #include <iostream> using na... (by markyrocks)
May 2021 Pages: 123... 10
  Archived months: [apr2021] [jun2021]

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