Beginners - February 2017 (Page 15)

typeid on vector
 
From the snippet of code below - is there anyway to return the actual name of the object? Thanks in advance! // // main.cpp // polymorphic vector...
[6 replies] Last: Thanks everyone! (by jamesfarrow)
scanf , printf
 
the reference says the %s should be a string type arguement but when i implemented it the compilers gave me a warning that's a char and it really only reads cha...
[7 replies] Last: Cool so basically %9s iterate over the string which is basically an ar... (by zeroblank)
Initialising and updating classes whose members have types defined by other classes
 
I have been trying to get though the drill in chapter 9 of B.Stroustrup's text "Programming: Principles and practice using C++". The drill expects me to output ...
[5 replies] Last: Date::Date(int dd, month mm ,Year yy) : d(dd), m(mm), y(yy) { // Or... (by cire)
[Not solved]Allow access to Private from external object method
 
Hi, I can not give access permission to a single method of a struct to another private structure part . The code only work if I declare the complete spy struc...
[7 replies] Last: #include <iostream> #include <string> class control; class kaos; cla... (by ne555)
need help with this
 
write a program that reads a line from a file called quote.txt containing the text, a.b.c.d.e,f and write the uppercase version of that line in reverse to the...
[14 replies] Last: Use a for loop to go through each character in the string. If you don'... (by closed account 48T7M4Gy)
Exception throw error
 
Exception thrown at 0x0F7D40DA this code works fine,first matrix 3x3 and second matrix 3x2 it give expection error at second matrix when i give some values to ...
[3 replies] Last: arr = new int*[ row ]; for (int i = 0; i < col ; i++) do a desk chec... (by ne555)
by rrush1
Functions
 
Having a problem I have to display a table with values of different activities using the very basic methods of functions with out references. I got the prompts ...
[4 replies] Last: You're getting confused about the syntax for the following things: - ... (by MikeyBoy)
by mounir
building under windows without using IDE
 
hi, i have the source code for GLFW (an opengl library) is there any way to build it for mingw compiler under windows without using an IDE. should i use mingw i...
[4 replies] Last: Thanks for help:) i find my solution here How To Compile Software Fro... (by mounir)
by F95
Delete post
 
Delete
[7 replies] Last: unsure how to make it so that 10 flight infos can be displayed std... (by gunnerfunner)
only revealing some letters at a time
 
Hi, I need help with unhiding a letter from a hidden sentence if the user guesses a letter that is in the sentence. For example if I put 'Hello World' as my...
[3 replies] Last: #include <iostream> #include <string> #include <cctype> #include <alg... (by lastchance)
Find the highest number in a file
 
I am able to generate 100 random numbers but i need to find the highest after that. What i have now gives me the last number in the sequence not the highest. An...
[7 replies] Last: Note: MAX_VALUE = 1000 is probably a more convincing choice, or altern... (by closed account 48T7M4Gy)
error message: abort() has been called
 
I have wrote a small function that swaps array elements and count the number of swaps. int swap(string array , int n) { int first = 0; int last =...
[4 replies] Last: @mbozzi that makes so much sense! thank you :) (by ejkang62)
How to run more the one input on one line
 
I need a for loop to test all the possible divisors from 2 up to half the integer being tested. the user should be able to write this : 20 -2 28 22 56 and it sh...
[9 replies] Last: Avoid deep nesting of loops, conditionals etc., and programming become... (by JLBorges)
Storing Data in a Tree-Like Structure?
 
In my code, I need to find a way to store multiple data types together in a sort of tree structure, like this, https://s1.postimg.org/mb6r8nuz3/tree_ex.png , wh...
[1 reply] : Put this information together into another struct? struct COURSE{}; ... (by gunnerfunner)
Having trouble converting string to int.
 
Whenever I compile, it says that stoi ws not declared in this scope. How can I fix line 47 so that I can convert the string to an integer? void load_strea...
[1 reply] : Some compilers don't support std::stoi for some reason, you can use th... (by gunnerfunner)
How to remove a value from vector
 
I have an exercise that is asking me to make a vector, fill it with 20 integers from 1-20 and then print it. Next, check to find repeat integers and then remove...
[1 reply] : See here for 3 different approaches to erase duplicates from vector an... (by gunnerfunner)
Reading data from a text file
 
I have to read data from a text file and sort it but I have no idea how to read the data. It was presented in geoJSON format. This is what the first entry looks...
[2 replies] Last: Okay thanks a lot I'll give it a try. (by avatar97)
Need help with structs.
 
I'm trying to print out the names of the students enrolled in the course. I have to do it through an enrollment array which is e. But the first and last name of...
[3 replies] Last: I can't help you.. I am missing some vital piece of info about how the... (by jonnin)
by cg1992
Homework Help
 
Hi, I am a CS student and currently have a lab that is due tomorrow, i've been confused and researching all week but still cant figure it out. I need to g++ co...
[5 replies] Last: You have to cin each variable you want to populate as if reading from ... (by jonnin)
Starting a Program
 
Write your question here. Probably a very basic question, but I don't know how to fix it #include <iostream> #include <iomanip> #include <cstdlib> u...
[1 reply] : this is probably correct. The first number from random is always th... (by jonnin)
February 2017 Pages: 1... 1314151617... 37
  Archived months: [jan2017] [mar2017]

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