Beginners - November 2019 (Page 7)

Array and function
 
So the function has to sum up and average the values entered in the array but its just displaying the value of the last entered value and I can't seem to figure...
[2 replies] Last: Hello sadshordie, When I gor the program to compile and run I found t... (by Handy Andy)
Can someone explain the arguments when creating a priority_queue?
 
I was learning about priority_queues and didn't understand what the second and third arguments are for when creating a priority queue in this example: std::p...
[5 replies] Last: Like most of the standard library, priority_queue is designed to be ve... (by dhayden)
Error in the Constructors
 
I am working with tries tree and have error in constructor. #include <iostream> #include <vector> using namespace std; using std::vector; class Elem...
[3 replies] Last: As far as I know, it should not compile fine, since there are several ... (by Enoizat)
by npat7
Displaying a text file
 
Hey guys, im having trouble with this code. Basically i have a text file with employee id numbers and their names next to them (ex: 8379192 Sean). I am asked to...
[2 replies] Last: Hello npat7, I did not mean to scare you off, but when the first line... (by Handy Andy)
C Programming - Create a Doubly Linked List of Strings
 
Hello, I am trying to create a Doubly Linked List of Strings, and I need to modify the void insert, delete, and print methods respectively. To insert a node wit...
[1 reply] : Lines 13-20 should be: struct node_t { char *str; ... (by dhayden)
Float variable
 
The output of float variable doesn't give the fraction other decimal place #include<iostream> #include<process.h> using namespace std; int main() { char ...
[5 replies] Last: Thank you Ganado, I appreciate your help (by semsemdiver)
Occurrence of word pairs
 
Sorry, I need to order the occurrences of the pair, what occurrences of the word pair in txt. map<string, int> freq; ifstream in("termosPares_small.txt"); ...
[14 replies] Last: A std::map can be ordered ascending or descending. Ascending order i... (by Enoizat)
Suggestions for keyword
 
I wrote a code for print a keyword using conio, any suggestions for improving? void teclado() { int lin, col, py; borda(); c_textcolor(WHITE);...
[1 reply] : Hello victorio, First suggestion post code that can be compiled and r... (by Handy Andy)
Question in integer var
 
Why if I did not assign zero for integer variables it may return wrong negative value? #include<iostream> #include<cmath> using namespace std; int mai...
[6 replies] Last: > cout<<"factorial of \t<<n<<"="<<endl; The wacky colour scheme that'... (by salem c)
Recursive Program
 
I've been try to get an array of numbers to order them selves with a picked pivot. The numbers greater than the pivot goes one one side while the others will go...
[2 replies] Last: Hello Deadweight77, To start with I would move line 42 to between lin... (by Handy Andy)
by CarlTY
Array function not working
 
Compose a capacity named arrayToFile . The capacity ought to acknowledge three contentions: the name of a record, a pointer to an int cluster, and the size of t...
[1 reply] : PLEASE USE CODE TAGS You could also do with a better translator! "com... (by lastchance)
Getting information from the internet
 
Hello guys. I am a beginner in c++. Yet, I have an assignment to make a chatbot that replies to questions regarding c++. I built a chatbot that had hardtyped ke...
[1 reply] : Double posted -> http://www.cplusplus.com/forum/general/265361/ There'... (by salem c)
How does the following code work?
 
I have problem understanding the following code calculating the factorial numbers smaller than a certain limit: int main() { long bound; cout << "Enter a ...
[2 replies] Last: Thanks a lot. (by jacks9807)
Sum of float and integer and its output
 
Hello :), float f = 0.0111; int i = 1010; float f2 = i + f; cout << f2; // output: 1010.01 I expected to get 1010.0111 for the output, but why is...
[7 replies] Last: to a point you can store it as 2 integers, the fraction and the whole ... (by jonnin)
Looking for website for binary tree / algebraic expression
 
Hi I am wondering if anyone knows a website or application that allows you to put in a algebra expression and it produces a binary tree? I am learning how these...
[1 reply] : Mathematica can take in an expression and build a tree (lists with emb... (by Ganado)
by ravss2
C to CPP Migration
 
I am trying to write a C++ solution for a problem which is written C, I have learnt C++ very long ago(may be 15 years), and the way C++ is evolved now is kind o...
[13 replies] Last: strings are compared slower than integers. So strings will be a hair ... (by jonnin)
std::sort function compile error
 
So, I'm supposed to use different sorting functions and and compare the times in microseconds to each other, to see which one is faster. The problem is that ...
[4 replies] Last: To get it to run, change line 304 to std::sort(array, array+size); ... (by dhayden)
by AL88
expected class-name before ‘{’ token
 
Why am I getting : Player.h:15:1: error: expected class-name before ‘{’ token Enemy.h:9:1: error: expected class-name before ‘{’ token in my ga...
[3 replies] Last: No forward declaration. Just #include "Game.h" into the SDLGameObject.... (by coder777)
Declaring structs/classes as private with a class
 
Problem: At various points in working with linked lists, stacks, queues and trees, I have tried to declare the Node struct as a private member of the tree (in...
[2 replies] Last: If Node is private to a class, then it will be inaccessible outside th... (by lastchance)
by deputy
2D array histogram
 
I need to print out asterisks for equal amount of value in this programm,but i'm kinda stuck with it.I guess i need another for loop or maybe not :).Anyway any ...
[3 replies] Last: Thanks :) (by deputy)
November 2019 Pages: 1... 56789... 17
  Archived months: [oct2019] [dec2019]

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