Beginners - November 2019 (Page 13)

Declaring and using a function within a function
 
Hey everyone I am trying to declare a recursive function within a function to use it to my purposes For instance /code #include <iostream> using namespace st...
Nov 6, 2019 at 8:50pm
[4 replies] Last: @jonnin I understand Thank you (by Jack Van Stone)
Get number in string in C++
 
Hello, I enter 30 and I expected output be 0 15 but I have 240 255. I think program multiple asci code with 5 but I want to multiply 0 * 5 and 3 * 5 #in...
Nov 6, 2019 at 5:59pm
[4 replies] Last: All mainstream modern systems encode chars using ASCII. -- well, act... (by jonnin)
Write a program to analyze different student data using structures
 
Here are my assignment instructions Write a program to read 20 student names and test score from a file and input them into student structures. You will ...
Nov 6, 2019 at 4:21pm
[2 replies] Last: Remove function highest(). You don't call it and it does the same thin... (by dhayden)
Help in Graph question
 
network consists of N nodes (numbered 1 through N) and M bidirectional connections between pairs of these nodes. A robust network is a network that contains a c...
Nov 6, 2019 at 3:50pm
[5 replies] Last: this has a lot of the hallmarks of a no-graph graph problem. I suspec... (by jonnin)
C Programming - Print array of random numbers and sort in decreasing order
 
Hello I am trying to write a program in C. For the program I am trying to print an array of 10 random numbers (using function rand();) while set the srand(); se...
Nov 6, 2019 at 11:38am
[2 replies] Last: To expand on JLBorges's fix: At line 19, you weren't printing the con... (by MikeyBoy)
by Bopaki
How can I properly initialize this array?
 
I get this error when compiling: In function `int main()': error: variable-sized object `inputArray' may not be initialized Execution terminated ...
Nov 6, 2019 at 9:53am
[2 replies] Last: Thanks last change here is the correct output: C:\Dev-Cpp\Chapter11>... (by Bopaki)
Remove zero values from Eigen Vector
 
Hi, For a program I am writing I want to obtain a Eigen::Vector with only the non zero values of another Eigen::Vector. Lets say I have Eigen:VectorXd my...
Nov 6, 2019 at 9:27am
[9 replies] Last: @Enoizat I will look into the sparse methods, not sure if this will he... (by Casperb)
Reading from File to STL Queue
 
So I have an assignment to read data from a file into an STL queue. I know how to do push into the queue but I'm not sure how to do it from a file. Can someo...
Nov 6, 2019 at 5:30am
[4 replies] Last: Thank you, I changed some things but I got it. Thanks so much! (by simulationspecimen)
Function to make output lowercase or uppercase wont run
 
Hi there, my program supposed to convert output to either uppcase or lowercase and count commas and consonants. My code can run but when I do cout in the main...
Nov 6, 2019 at 12:46am
[2 replies] Last: wow, i see, thank you very much. (by trannghi7707)
Simple traversal function crashing
 
Hello, the 'add' function below seems to be creating nodes accordingly. However, trying to display node is not working. It crashes when I attempt to hop to nex...
Nov 5, 2019 at 10:09pm
[8 replies] Last: Lastchance, yes initializing struct Node* next=nullptr did it. It is s... (by mrpear2020)
Reading a text file
 
The assignment is to download a file called words.txt. Read all the words from the file and store them in a vector. Calculate the number of words, total numbe...
Nov 5, 2019 at 9:15pm
[8 replies] Last: Also keep in mind that you don't *need* to use backslashes, C++ stream... (by Ganado)
SIGN-UP/LOG-IN: Login While loop exits early
 
I'm sorry for passing through here again but i swear, I'm almost done. The problem lies in the last part: the while loop for confirming the username/password...
Nov 5, 2019 at 7:02pm
[4 replies] Last: Line 14: w is uninitialized Line 26: why decrement num a second time? ... (by dhayden)
by Hay9
Try to replace "cout" by "ostream"
 
Hello I try to improve my code to become a better code with the book "C++ Das umfassende Handbuch" by Torsten T.Will. He writes that instead of using cout, i...
Nov 5, 2019 at 3:02pm
[3 replies] Last: @Duthomhas: Thanks. This helps. I understand now that ostream& is a f... (by Hay9)
by km5392
Trying to set conditions and exit my loop with certain input.
 
Hi, I"m writing a program to acquire an amount and reject anything less than 1000. Also have to make sure program quits if 0 is the input. double amount = ...
Nov 5, 2019 at 2:51pm
[6 replies] Last: Thank you all for the input! It has be very helpful and I think I hav... (by km5392)
send images to client
 
From the server, I am trying to get multiple images from a folder and send them to the client with a certain fps. I couldn't find much online, can anyone kind...
Nov 5, 2019 at 2:12pm
[1 reply] : just send them to begin with as fast as you can, and ignore the FPS re... (by jonnin)
Printing triangles
 
Hello guys!I am a beginner of studying c++. I know how to print one single triangle by using the for loop, but how about printing consecutive triangles. Hope to...
Nov 5, 2019 at 2:08pm
[1 reply] : for now you can repeat what you have or change how it draws in the sec... (by jonnin)
by Zii
Loop ending when expected to continue
 
Oof, sorry about posting twice in a row... Another problem, likely very simple. Skip to lines 64-84. I'm trying to make it so that the user cannot proce...
Nov 5, 2019 at 1:23pm
[2 replies] Last: Thanks, I didn't realize there was a preference vs executing it in ord... (by Zii)
SIGN-UP/LOG-IN: "enter password" gets erased
 
Hi, I have another problem I'm hoping someone could help me with. We were tasked to make a sign-up program where only the password has the validation: atleast 1...
Nov 5, 2019 at 1:02pm
[12 replies] Last: You're right! I just added a counter for the characters and it worked.... (by WywrdAF)
by Zii
Runtime issue when trying to print a sum
 
So I have spent the past 2 hours trying to figure this out. Can't wrap my head around it. First I had "money + 1;" or "money + 5;" etc. depending on the selec...
Nov 5, 2019 at 12:53pm
[5 replies] Last: I appreciate the help guys. I can't believe I made such a simple error... (by Zii)
Convert decimal to base 2 in C++
 
Hello, I wrote a program to convert decimal to base 2 in C++ and work fine. I use Array. Can I write this program without any data structure or built-in func...
Nov 5, 2019 at 10:29am
[1 reply] : #include <iostream> using namespace std; void binary( int num ) { ... (by lastchance)
November 2019 Pages: 1... 1112131415... 17
  Archived months: [oct2019] [dec2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.