Beginners - June 2020 (Page 10)

Player DVD program
 
Hey guys, I need to do an assignment for university, but I'm a complete noob, so maybe you can help me here. There is piece of code below and I need to complete...
[1 reply] : What have you learned about C++ so far? Do you know how to write a cla... (by Ganado)
Making sure there is a certain character in string
 
Hello, how do I make sure the input that I get ends with a full stop '.' using do-while? Example: Hello. #include <iostream> using namespace std; void upper...
[7 replies] Last: Careful - this will not behave properly if the string is empty. (by mbozzi)
offset values and operators to increment pointers
 
line 17 "Counter" is undefined. how do I fix this? // Listing8.9.cpp : This file contains the 'main' function. Program execution begins and ends there. ...
[2 replies] Last: oh ok. thank you!! i was sitting there for 30 mins. couldnt figured ... (by tuanle007)
by taniam
Math problem
 
I just started learning C++ and I have to solve this problem: Let be x an integer variable. For what values of x does the expression x+7==8*x take the value 1. ...
[5 replies] Last: 1) that is just mathspeak. x is a variable. It could be 23. It cou... (by jonnin)
expression must be a modifiable lvalue with 2D arrays
 
Hello, I have an error in the constructor. Please help me. Thanks #include <iostream> #include<string> using namespace std; class MyMatrix { p...
[2 replies] Last: my = s can be changed to: memcpy(my,s, sizeof(int)*9); //9 is 3*3. m... (by jonnin)
by mpelle
My code only works for specific test cases, and I'm not sure why.
 
I'm doing an extra credit assignment and my teacher said that my code doesn't work for all test cases, only specific ones. I'm not sure why. She also said that ...
[3 replies] Last: result is meant to change, it is the sum of the values in the row of ... (by George P)
Help With #define
 
Hello, I have a problem with #define macro. I would get _DIGIT_ number x with the macro _DIGIT(x) #define _DIGIT_0 5 #define _DIGIT_1 6 #define _DIGIT...
[9 replies] Last: this looks like you want an enum to me. (by jonnin)
by mj425
Functions
 
I'm trying to pass the total from another function to the main function but I'm having trouble. I keep getting 1.5 instead of 7. What am I doing wrong? #incl...
[2 replies] Last: from time to time, just redoing it feels like the best way to xplain i... (by jonnin)
pointerS, HOW COME my answer is different from the book
 
how come my answer is different from the book? are the addresses not the same? Integer age = 30 Integer dogsAge = 9 pointsToInt points to age pointsToInt = 0x0...
[3 replies] Last: at little more on that, a pointer is the location in your computer's ... (by jonnin)
1D array problem
 
Hi Everyone! i have a small program here,i let the user choose the size of the 1D array and it's elements and if they want to print it they should press 1.. no...
[2 replies] Last: int a ; creates an array with zero elements in it, and no way to cha... (by George P)
functions not working
 
Hello again, i made some progress with this code, now the problem i face is everything works fine except for the 3rd option, i see both functions are written c...
[7 replies] Last: int x=1; while (x == 1) cout<<"thanks alot man"<<endl; (by jeraya6)
Help With Averaging
 
I have made this post before with answers that solve a previous problem but now a new one has shown up. When you enter the first value the code doesn't go onto ...
[10 replies] Last: All problems with the code have been fixed, A file was simply in the w... (by LegalWeasel)
Help With Averaging Code
 
Write your question here. Could someone help me figure out why the program has an initialized local variable? #include <iostream> int main() { int n; ...
[5 replies] Last: Hey there, Thanks for all the advice given, sorry if it was a bit of a... (by LegalWeasel)
BST Algorithm Copy Only Even Data
 
I am looking for assistance with an algorithm to copy even data in a BST of integer data. I have a somewhat working algorithm, but it misses some right nodes, a...
[4 replies] Last: Yeah, the intent (I imagine) is more problem solving. But yeah, some o... (by confundido)
Parsing string
 
Say I have a string with json like data such as "{"flight_number":65,"mission_name":"Telstar 19V","mission_id":["F4F83DE"],"launch_year":"2018"" How can I ex...
[4 replies] Last: Your structure is: { "A" : B , "C" : "D" , "E" : ["F"] ,... (by dutch)
How to update the data in txt file
 
Im trying to update the data but I am not sure on how to update it. ofstream myfile; myfile.open("data.txt"); cout << "Update the existing data"<<endl...
[6 replies] Last: That is why Im having problem when updating the file. I have already m... (by rhap123)
Error Spotted In Places With No Error.
 
Error Spotted In Places With No Error. Expect a ';' at line 26. Syntax Error: 'string' at line 30. Syntax Error: ';' at line 34. Syntax Error: missing';' befor...
[1 reply] : The word "string" doesn't appear a single time in the code you've show... (by helios)
Is a class the answer to my function mess?
 
I periodically write code for embedded microcontrollers. Most of it is pretty simple. I've gotten by using functions. Some functions have static variables whi...
[5 replies] Last: To make Jonnin's suggestion fully match your original post, you'd add ... (by dhayden)
Taking output of pgm file format to construct frequncy table
 
here I am reading a PGM format I want to construct a frequency table for Huffman compression and decompression in C++ how can I extract the output of the pictur...
[3 replies] Last: > i'm new to C++ and data structure Perhaps you should start by writin... (by salem c)
by kenken
While loop help
 
Would someone please help me understand why the following codes produce different outcomes for the variable sum when the variable number's type is changed to un...
[3 replies] Last: Both sum AND number wrap around when entering -1. std::cin goes int... (by George P)
June 2020 Pages: 1... 89101112
  Archived months: [may2020] [jul2020]

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