Beginners - July 2020 (Page 8)

by roym
speed of vector filling: Matlab vs C++
 
Hello, I recently (2 months ago) started learning C++. Before that, I always worked with Matlab (2-3 years). People always use to say that Matlab is slower th...
[10 replies] Last: ^^ The actual c++ wrapper is pretty small -- its going to be 99% libr... (by jonnin)
by zavkk
I want to make a program with a time to respond
 
I want to make a program where the console gives me numbers and i have to multiply they in the time i give, for example 5 seconds, but i don't know any method t...
[1 reply] : this is tricky in console. you can time it with clock() if the time ... (by jonnin)
for,if,even,max,min
 
hey lads, Hope you can help me, I have to do my HW as below: Solve a+b-c for "n" times, following the conditions: 1. Calculate the Sum of all the Resul...
[11 replies] Last: @dhayden thank you very much indeed sir! (by MaxGreen)
by yem
Derived classes using "parent's" nested class
 
Hey, I've had this problem before with linked list and never really managed to solve it. I have a generic Tree class which has a nested Node class. For my ass...
[2 replies] Last: Thanks! (by yem)
memory allocation different when lookup in system monitor
 
I write a c program to allocate specific size of memory and free them in Ubuntu. Defaultly, it create 100MB memory by malloc 1MB for each entry of a 100 size...
[1 reply] : https://duckduckgo.com/?q=linux+overcommit+memory&atb=v203-1&ia=web Li... (by salem c)
Subnetting Program -- [variable] was not declared in this scope"
 
I"m writing a subnetting program, and I'm having an issue with scope and inheritance. Basically, I've created 4 integer arrays. I want these integer arrays ...
[6 replies] Last: Notes: IPv4 address is a 32-bit unsigned integer. One number. The dot-... (by keskiverto)
Arrays
 
How would I write an array that uses a constant measurement, increments over 50 components, but then prints the components in incrementing intervals of 5? Ex...
[12 replies] Last: Handy Andy, thank you for keeping up with my question and working thro... (by Fayezilla)
sorting upper and lowercase names together
 
I don't understand these errors send the name to check dupe function could not convert '(std::string*)(& tempName)' from 'std::string*' {aka 'std::__cxx1...
[10 replies] Last: THANK YOU, im reviewing rn (by pnwadike99)
Constructor and Destructor in C++
 
Hello, Why is the destructor called 4 times? We create two objects, but we destroy it four times. that is weird. I expected it to be: CCDD Thanks Output is: C...
[2 replies] Last: Line 27, an object is default constructed in main. Line 17, a copy of... (by George P)
Problems parsing/using void functions
 
In my program, we are supposed to uses classes and void functions to create a program that gives the average box office and run time of five movies from a file....
[4 replies] Last: Gotcha, sorry about that. (by greenway)
does the target of a makefile have to be a file name?
 
Hi I have a makefile which includes the following rule/recipe bin/test.exe: $(TEST_OBJ_FILES) $(LIB_DIR)/$(LIB_NAME) | $(BIN_DIR) $(CC) $(FLAGS_E) $(...
[2 replies] Last: tests: bin/test.exe bin/test.exe: $(TEST_OBJ_FILES) $(LIB_DIR)/$(LIB... (by dhayden)
by ZunLee
I need help with creating a function!
 
Hey guys, I have written some code that I'd like to create as a function but I'm not getting any success. This is the working code: #include <iostream> ...
[5 replies] Last: Hello ZunLee, Some additions I made that may help. Above your "Major... (by Handy Andy)
Can't assign a char to a string
 
I have a conversion error when I do this, what is happening? string b = "abc"; string a = b.back(); Also I am using code block ide to do this,...
[4 replies] Last: Dutch , I thought the same thing. It seems so obvious that there mus... (by dhayden)
should I take out high level methods from a class?
 
Hi I have a class like this: class Something{ private: // data structures and internal methods public: // low level methods for accessing ...
[3 replies] Last: // high level analysis methods , some of which use internal methods... (by dhayden)
closes program after first set of instructions
 
it ends after outputting the names after first import string usersFile; //stores users file name const int MAX_RNDNAMES = 5; //list size int nrn...
[3 replies] Last: Hello pnwadike99, Although Thomas1965 makes a good question it is a... (by Handy Andy)
Change Playdirection
 
Hi, For my project I wanna change the playdirection. So for example: Im playing with 3 players (Josh, Eric, Harry). In the first round the direction is like th...
[2 replies] Last: Thanks! (by QatarAirways)
no matching function for call to 'getline??
 
no matching function for call to 'getline(std::ifstream&, std::string )' 55 | getline(fin, rndName); what does this mean? string usersFile; ...
[3 replies] Last: thank you (by pnwadike99)
Output issue reading in 2 files
 
Hello! I am reading 2 files into a program, a client list and transaction file. When the Client ID's match, I need to increment the total on the Client list b...
[13 replies] Last: It's not about copying this but this might be useful. There's a probl... (by againtry)
integer literals - compatible data types
 
Hello, I am reading a beginners guide and it says "By default, the c++ compiler fits an integer literal into the smallest compatible data type that will hold it...
[5 replies] Last: float is commonly used in computer graphics because they are faster ... (by mbozzi)
Doubly linked list
 
I have been asked to have a go at 'modifying' a linked list into a doubly linked list. I have had a go but seem to be struggling somewhat with my remove and ins...
[12 replies] Last: Thanks for all the help. I finally realised that I disappeared down a ... (by jamesfarrow)
July 2020 Pages: 1... 678910... 12
  Archived months: [jun2020] [aug2020]

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