General C++ Programming - November 2019 (Page 2)

by cgm2k7
Read content from a text file
 
Hello good day! I have a hard time if anyone can help me thank you: It is as follows, I have a tex...
[1 reply] : Open file: ifstream file ("some_file.txt"); Get first word ("name"... (by Repeater)
I'm trying to add the values stored in an array.
 
its printing a big negative number. #include <iostream> #include <string> #include <iomanip> #inc...
[4 replies] Last: Or that they don't pay attention to what is being said. https://www.dr... (by salem c)
why i can't use auto on typedef?
 
why i can't use the 'auto' on typedef?
[17 replies] Last: Peter87 that's a good point too. thank you (by Cambalinho)
Reading in imaginary numbers
 
Hi, I'm trying to figure out how to do the first part of this problem. Here is the instructions: ...
[1 reply] : for c++ complex type, its simple enough: complex<double> p; cin... (by jonnin)
.c_str() Error
 
I'm getting an error when using .c_str(). The error is "left of '.find' must have class/struct/unio...
[6 replies] Last: Thanks for the suggestions. My instructor ended up helping me; I'm pr... (by terina00)
by Tawwy
How To Work Out This Part
 
I created the 3 functions already but I'm not sure how to do these two parts of the question. PAR...
[5 replies] Last: So post what you have so far. (by salem c)
vectors: how create and initializate multidimensional? (1,2,3)
 
how we initializate a multidimensional vectors? we can do: vector<int> vec{3,4,5}; but we can't...
[42 replies] Last: i will create a new topic, because of the next question ;) thank you s... (by Cambalinho)
Template version of merge sort
 
Hi there, How do you create a template version of the merge sort below? Many thanks in advance. ...
[1 reply] : First up, fix this illegal C++: int temp[high-low+1]; cin>>n; int... (by Repeater)
Unintentionally, each score does not come out, but the combined score comes out.
 
What I wanted to do was take 10 arrays of structures and get the number of each array of structures....
[4 replies] Last: Thank you so much for the answer I wanted. It was simple to think of i... (by somang317)
get the type to which a pointer points
 
How to retrieve/get the type to which a pointer points on compile time like t illustrated in: int ...
[4 replies] Last: The compiler sees the code and so do you. While type info is available... (by keskiverto)
Needing help with this function and ->
 
I have been working on this assignment for class and need help I'm stuck on this function it inserts...
[2 replies] Last: For some reason I thought I saw 'tree' not linked list. The above tre... (by jonnin)
How to combine fft and ifft function using class?
 
Hi, I am doing fast fourier transform(FFT) and inverse FFT (ifft) and I am using class in my code. ...
[5 replies] Last: @Nurulhuda, I don't understand your code, but if you want an FFT witho... (by lastchance)
C++ ELSE PROBLEM
 
#include <stdio.h> // Begin Main main () { // Define variables int num1 = 0; int...
[4 replies] Last: //... //... bool f=true ;//set flag if (choice == 1) { // Add num1... (by marhuum)
size_t is all about
 
What exactly is size_t all about compare to int , and what's their differences?...
[2 replies] Last: std::size_t is just a fancy way of writing and explicitly telling th... (by malibor)
by Ric
Help with a program
 
I need help with creating a program that defines an array of five integers and a pointer to an integ...
[9 replies] Last: #include <iostream> using namespace std; int main() { int a ; ... (by eyssant)
Print out size of array
 
I need to write a statement that will print out the size of the array. I have it to where it will pr...
[4 replies] Last: #include <iostream> using namespace std; int main (){ int MyAr... (by eyssant)
default of function alias arg.
 
Is there a way to set the default of function alias arg. so having option to be one or two argument ...
[1 reply] : note that in your code sample, second argument always exists, wether s... (by malibor)
How to output this on a table and also output if the subject is credited or not based on the input on the program
 
void input_grades(void) { clrscr(); string subj ={"CHN11","ESN111","EN111", "ESN110","FI101","M...
[no replies]
Efficient way to search within unsorted array
 
I have an unsorted array A containing value within range 0 to 100. I have multiple query of format Q...
[3 replies] Last: Set up a vector< vector<int> > bucket( 101 ); Pass once through the a... (by lastchance)
selection sorting
 
hey guys, I am fairly new to c++ and I was trying to finish this code for my last lab. I've tried al...
[4 replies] Last: Modify your main() function as below: int main() { const int size = 1... (by eyssant)
November 2019 Pages: 1234... 8
  Archived months: [oct2019] [dec2019]

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