Beginners - June 2017 (Page 10)

fin.fail
 
Hello, I am trying to read a file and take the average of the sum of grades and display the average. I am able to do that just fine, but I am just trying to fig...
[1 reply] : std::ios::fail() isn't really used for what you think it's used for,... (by xismn)
/MT causing unresolved externals.
 
So I am attempting to redistribute my program, yet I am met with 'Missing VCRUNTIME140.dll', but that's no issue just use '/MT' right? Well, I tried that and no...
[3 replies] Last: Ah okay. I will try that thank you! Edit: All compiled correctly afte... (by ExSanity)
how to use cin.ignore
 
if the user types in a letter for id2 , the first getline will fall through (it will be empty), i thought i would have taken care of that by using cin....
[3 replies] Last: All read operations (including ignore) will fail automatically if an e... (by Peter87)
by darje
sort linked List
 
lets says i have 5 elements in the linked list 3->1->4->2->7; i want after calling sort method its will become something like 1-->2->3->4->7 without the inser...
[2 replies] Last: hey Handy Thanks for the help mate i will try tomorow morning to work... (by darje)
by Ephan
Nested for loop and if conditional, to draw a pattern ??
 
Hi c++ lovers :) This code that contains nested for loops and if conditional made sense to me to half way through. When you take a look at the outcome, I unde...
[4 replies] Last: Hi coder777. Both the codes you provided make things really clear an... (by Ephan)
how to reply
 
Write your question here.
[1 reply] : Hello somefight, Welcome to the forum. If you have not read these yet... (by Handy Andy)
.eof() confusion
 
Hi, I am having a bit of confusion understanding the full extent to which I can use the .eof() function from the iostream library. Can this function be used...
[8 replies] Last: This is why I'm askingĀ  https://www.hackerrank.com/challenges/30-di... (by gunnerfunner)
What is the proper way of declaring the copy assignment?
 
I just took a class in c++ and one of the things we learned how to do was create classes, throughout the semester we were always declaring the copy assignment w...
[5 replies] Last: It means that it returns a const reference. That prevents you from do... (by dhayden)
by ChocoG
Calculate with pointers?
 
Hello, I want to create a little program... As first it should save the current Mouse position. Then it should save it again after some seconds but this time i...
[3 replies] Last: What is the type of _calcPlayer and _calcEnemy ? What does the GetC... (by keskiverto)
by Ma92
struct
 
Aslam u alikum , this code has logical error , i declared two structures name st1 st2 i copy st1 to st2 after writing st1=st2 i tried to print values using st...
[2 replies] Last: thanks jib (by Ma92)
Constructor cannot be defaulted
 
Node.h #ifndef NODE_H #define NODE_H template <class someType> class Node{ private: someType data; Node* next; public: ~Node(); Node(...
[5 replies] Last: [quote=jib]In the code supplied you don't need to use either the = def... (by Peter87)
Function arguments
 
How to write a function that will accept an argument of any c++ type but not any user defined type. Even if we succeed in doing so, how to know what type has be...
[1 reply] : Also if I want only specific type example like only int, string and s... (by mbozzi)
Infix to Posfix
 
Hello. Can someone help me with my code. Inserting the infix expression "2 + (3 + (4 + (5 + (6 + (7 + 8))))" it gives error in the initial part in which convers...
[no replies]
by jlb
Class
 
Look at this snippet: Fraction::Fraction Add(Fraction otherFraction) { ... int Fraction::LCM(int a, int b) { ... Fraction Fraction::Reciprocal() { ... Do y...
[1 reply] : Here is the original code for future reference. //Header File <fract... (by jlb)
by cjelin
return value
 
I am very new to the programming world. I am really stumped on this one. I need this code to return the billing amount. I'm sure it is something super simple, b...
[3 replies] Last: That fixed the issue! Thank you so much!! (by cjelin)
ifstream and ofstream - EOF while loop
 
I've been confused on how to use ifstream an ofstream correctly. I'm not completely sure how to write a program that reads the first row of a text file and tha...
[1 reply] : Take a look at this tutorial: http://www.cplusplus.com/doc/tutorial/fi... (by chicofeo)
by Bicubo
How do I use a function's return value?
 
I have been trying to get a return value from my logic function in my Ticktacktoe program. I just can't figure out how to return and check returned values prope...
[1 reply] : IMO, your functions are doing too much. Each function should do a litt... (by jlb)
Iterator and map
 
Hi guys , I've a map : map<string,Question> mapQuest; In which Question is a class defined in this way : public: Question(){}; Question( ...
[1 reply] : The map elements are stored in std::pair. http://www.cplusplus.com/ref... (by Peter87)
Understanding pass pointer to pointer by reference in c
 
void func(char *ptr) //Passed by reference { *ptr = 'B'; } int main() { char *ptr; ptr = (char *) malloc(sizeof(char) * 1); *pt...
[1 reply] : The pointer is passed by value. The function doesn't modify the pointe... (by Peter87)
by Snow14
Arrays
 
Hi everyone i hope that you are doing well i have a question please about the arrays, i gave each case in the array a price for a specific item, later on i sug...
[5 replies] Last: Hello Snow14, i want to print before the total something like : (tot... (by Handy Andy)
June 2017 Pages: 1... 89101112... 16
  Archived months: [may2017] [jul2017]

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