Beginners - July 2020 (Page 2)

expected a declaration error
 
Hi all, In my entire script for every for loop and if statement I am getting a error "expected a declaration" I am not able to debug this,What does that mean...
[3 replies] Last: https://stackoverflow.com/questions/15104067/error-expected-a-declarat... (by againtry)
Pointers and Reference!
 
1. Declares cHelp to be “a function returning a reference to a char” that has a parameter named help that’s “a reference to a float”. 2. Declares a...
[5 replies] Last: 5. Type casts (C-style) dpA dpA? in abc = (short *(*) ); ?... (by keskiverto)
Method/ function call problem
 
I'm doing an exercise about method/function calls. Codes below. The exercise asks any code below is wrong. My understanding is the method DisplayProduct calls f...
[3 replies] Last: some systems make long double and double same, but you still should be... (by jonnin)
Problem with complex and double numbers
 
So, I am writing a code where I have to use matrices of complex numbers. Till now, I declared these matrices as arrays of double numbers and I assume that tw...
[2 replies] Last: You could use structs or classes to represent the complex numbers. Or ... (by Shishykish)
Why do I keep getting unknown class error even though I have included them all in the header files?
 
Hello, I have coded some classes for some computational exercises. But I cannot declare and assign an object of a derived class despite it being included in...
[6 replies] Last: Hi all! Thanks for your help I was able to sort the unknown class is... (by Shishykish)
Reading user input to then output part of an array
 
I am trying to read in the user's input for the year so I can output who won the national championship for that year by using two parallel arrays but I am runni...
[5 replies] Last: I see, for whatever reason Visual Studios was not showing the warning ... (by greenway)
by bxdobs
needing to create a 32b tcsh.exe that runs in w7 or above
 
Update/Solution Found: Took a closer look at the log file revealed that the -mx compile flag was complaining and failing due to unresolved warnings of unused va...
[2 replies] Last: Thanks Andy ... was struggling with this compile ... wrote the post ..... (by bxdobs)
void pointer not printing?
 
I'm trying to just simply print the contents of dat and then try to dereference it but nothing gets printed, instead I'm guessing an exception is bring thrown a...
[4 replies] Last: Yes, the overload for ostream operator << treats char* as a null-termi... (by Ganado)
Storing int and strings from a file into arrays
 
I am trying to take int values and strings, which are both in the same file, and store them in an array to be used later on. How do I store the int and strings ...
[9 replies] Last: Awesome, I figured out how to get the ints and string values stored in... (by greenway)
by sparki
Variadic templates c++17
 
Hi, I have implemented the following code below on variadic templates for creating exponents of 2 based on c++17 standard, however, my lecturer has thrown in ad...
[14 replies] Last: Get rid of the +1 and say if constexpr (Count_t == 0) return seq<... (by mbozzi)
interpreting pseudo-code
 
I was given this assignment to do, but the pseudo-code doesn't make much sense to me, can anyone interpret this for me. (i'll explain why i'm confused down belo...
[4 replies] Last: for (int k = 1; k <= (n*n); ++k) <= to include n*n (by ne555)
by bld
How do I check, if a certain key is pressed?
 
I want to make a Linux-compatible program, that does something upon a key press. I know, that you can do this for Windows, but I couldn't find a way to do this ...
[4 replies] Last: I really don't feel like going through the entire thing now. @salem ... (by againtry)
How to use classes and destructors properly?
 
So the purpose of the project was to use a destructor to print out the percentage of the gas tank that was full. I want to remove int main() but it doesn't work...
[6 replies] Last: Thank you all for the help! I got it up and running, and to answer dha... (by nikovch)
Populating an array with int and string values
 
I am trying to use an array to hold int values and strings, which are both in the same file. I would like one array to hold the year and the other array to hold...
[1 reply] : Duplicate of http://www.cplusplus.com/forum/beginner/272043/ . Plea... (by MikeyBoy)
Returning multiple values from function
 
Hi all, 1. How to return multiple values from the function(for example how to return the four multiple float values from the function)? I tried in internet, ...
[4 replies] Last: Thank you @againtry (by Shruthi LS)
expected unqualified-id before '{' token
 
hi there. i just started studying c++ and i was doing an excercise when i started having these problems with classes. I'm using Dev-C++ to write my code since i...
[12 replies] Last: :) (by againtry)
How can I address the multiple definition error in my derived classes from a abstract virtual one?
 
Hello, I have made a program to calculate the numerical solution of an ODE. I am familiar with the technique to do so, but in a this task I have been set, I...
[3 replies] Last: If it compiles, it's only because you only have one compilation unit (... (by Ganado)
string functions
 
Hello, I am learning string functions from a book, however, the book was published in 2003 so some things may no longer be relevant. The functions I am trying o...
[5 replies] Last: ...that they are unsafe and are deprecated Sounds that you use Visua... (by Thomas1965)
pointers address (1,2)
 
Hello, I have been learning about pointers, and now on pointers to pointers, and made a small program to test all the data stored. I wanted to check the pointer...
[32 replies] Last: I am well aware of its definition. As I have said, I don't care about... (by againtry)
Code not printing the things I want it to print
 
Hello! I am having issues printing the correct things. My teacher asked me to create a class that describes a passenger plane's properties and allows the plane ...
[7 replies] Last: An except of where this (modified & extended) can lead: // Creat... (by againtry)
July 2020 Pages: 1234... 12
  Archived months: [jun2020] [aug2020]

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