Beginners - August 2020 (Page 7)

function template and adding array with lambda expression
 
I have been learning the basics of templates and lambda expression, and there's one exercise that I am having with knowing how to invoke the lambda function. it...
[6 replies] Last: Yeah that was going to be my approach. But was start on how to pass tw... (by closed account 26q2b7Xj)
fatal error LNK1120: 1 unresolved externals
 
#include <iostream> #include "console.h" using namespace std; int main() { Console::setCursorPosition(5, 5); cout << "1"; } Hey everyone, i am tr...
[1 reply] : you have to compile and link the c++ or library file with the code in ... (by jonnin)
Print lines from text file after user pressing enter
 
I'm writing a 'read file and print line' program described below. 1. Accept user input for filename and number of lines from command line. e.g. File1.txt 3 2. P...
[6 replies] Last: Ideally, you should account for the possibility that the line is longe... (by dhayden)
Assigning vectors as instance variables
 
In my .hpp file, my class is a graphe I have as follows vector< vector< Arc * > * > _adjacences; // adjacency list in my .cpp file, I was able to cha...
[12 replies] Last: You must either set their size, or you can have the size increment au... (by againtry)
by borgh
Write on file (1,2)
 
HI, I'm new with c++, I create a file with different name every x time, the first time the file is correct, other times is empty... Where's the issue? ...
[21 replies] Last: And for anybody wanting to know more about Hungarian notation, and ine... (by againtry)
by Havie
How to know a char* is an array?
 
Hello I am familiar with C#/Java and am reading ATourofC++ So far so good but I came across this : "it is often wise to check that a pointer argument that is...
[17 replies] Last: "Should not" works. You can run pointers through storage allocated to... (by mbozzi)
i need some help
 
The MotorSales Company has 15 employees. The employees have an annual sale that usually takes place in the last quarter of the year which includes October, Nov...
[8 replies] Last: i still struggling to understand how to deal with array in c++ Anoth... (by George P)
C++ taking much time than C in first run of hello world
 
Hello all, I have just started learning C++, but I have good knowleg of C. when running the simple code "Hello World!" on C++ and C starting by an empty fil...
[8 replies] Last: It is moslty the compile time, Yes, C++ generally does take longer to... (by Ganado)
Structures with Pointer Members
 
I'm up the chapter Structures with Pointer Members. I'm finding pointers to be very confusing. Anyway they have a "complete this program" section which i'm c...
[8 replies] Last: After surfing around various websites it became apparent that each Per... (by againtry)
by rhdd
Place "text or image" in a position on the screen?
 
How can I position a text or image anywhere on the screen? I'm using Visual Studio C ++!
[5 replies] Last: @Furry Guy Thanks for the URL. Yes, that's the one I've tried install... (by whitenite1)
C++ templates
 
Please consider the snippet below: #include<iostream> using namespace std; template<class T, class U, class V=double> class A{ T x; U y; ...
[4 replies] Last: In general, objects of a particular type must be aligned - placed in... (by mbozzi)
malloc function
 
I come across this code in an assignment. It is a MC question so it may be incorrect. I want to understand it first. Does the 1st statement mean allocate 3 byt...
[2 replies] Last: p += 3; // means p = p + 3; Now, the p is a pointer to long . Poi... (by keskiverto)
Proper use of constructors
 
I am working on a project and have completed the code, which sorts names from an array alphabetically. The problem is, we are required to use a constructor but ...
[4 replies] Last: I am going to echo jlb but assume you are new to all this... so 'why' ... (by jonnin)
passing parameters in functions having struct
 
I have hard time understand below. Could anyone please advise? Thank you. struct vehicle truck;//first we have this declaration void foo(struct vehicle &);//...
[3 replies] Last: Thank you! (by Simon90)
break statements
 
Hi, I am going through a book that has some small problems and answers, and one of the answers I am slightly struggling to understand. It has to do with a break...
[10 replies] Last: So there we have it. You don't know. But I don't answer to bulging rul... (by againtry)
Should I use a templated class here?
 
[4 replies] Last: @rozick1 Please DON'T delete your question after it's been answered. ... (by MikeyBoy)
i need some help
 
Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle.  Write a function triangleShape that takes as ...
[1 reply] : What, specifically, are you having trouble with? The first few parts ... (by MikeyBoy)
by Mif
Filter input to only numbers in C
 
How to receive input from user, only numbers? this is my code: #include <windows.h> #include <stdio.h> int a; int b; int options; void premenu() { prin...
[2 replies] Last: Thank you Manga .. this was very helpful !! :) (by Mif)
Reading from a file with getline, won't work the 2nd time?
 
So I added identical code to my project and the 2nd for loop won't print out "testing". userandPwNumb value is the same for both for loops. I tried cin.clear() ...
[3 replies] Last: This works, the first seek I have inserted isn't actually required bec... (by againtry)
trying to do something simple with pointers and structs
 
This is just some testing around with structs and pointers. So in this test i am just trying to print out james's best friend, which should be "Kris", but inste...
[2 replies] Last: thank you (by JamesHelp)
August 2020 Pages: 1... 5678
  Archived months: [jul2020] [sep2020]

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