General C++ Programming - January 2017 (Page 9)

Infinite loops issue
 
when i compile and run this, It continually loops and never ends, can someone explain why? string answer = "yes"; while(answer != 'y' || answer != 'Y'...
[2 replies] Last: I changed the variable answer to "no" and used && instead of or st... (by mrphilipp7)
Interview Question Trap!
 
There's a trap in interviews today, and I'm wrestling with how to address it. Let's take for example the classic question of how to reverse a singly-linked lis...
[3 replies] Last: as an interviewer, I would love it very much to see you throw a well-d... (by Cubbi)
Convert console app to Win32 app??
 
I have this console application, that converts simple words into complex passwords and would like to put it into the form of a basic project and create a UI so ...
[3 replies] Last: This is probably overkill for what you're doing, but might give you so... (by AbstractionAnon)
sorting parallel vectors?
 
For PPP2, I have to do an exercise whose specs are as follows: Read five names into a vector<string> name, then prompt the user for the ages of the people ...
[12 replies] Last: Thanks. That helped. I got it. (by DragonOsman)
Create Desktop Icon to Execute C++ Code
 
Hi, I have tried various ways to start C++ & Unix (Mint)and struggled. I have programmed Expert Advisors for MetaTrader (A forex platform) which looks very ...
[7 replies] Last: Gotcha - works fine. (by peterhw100)
How to divide the input taken from user in two parts and assign them to two different arrays in C++?
 
Hi Guys, basically if we take the input from user by asking him, like below: cout << "Enter your course code and course name: "; Now if user enters this "...
[5 replies] Last: I assume this is one of this horrible C++ courses where you have to u... (by khaw235)
by SCB3
Weird Error at runtime ( 0xC0000005: Access violation reading location 0x00000000.)
 
So I've been struggling to understand why I'm getting an error like this and I'm really not sure how to solve it or why its happening, can anyone help? Error i...
[3 replies] Last: @ SCB3 Consider using a range based for loop rather than begin and ... (by TheIdeasMan)
Printing a type description works inversely for arrays!
 
Hi, I have the following code: template <typename T> struct type_description; template<> struct type_description<int> { operator const char*...
[7 replies] Last: Hi!! I thought I would support for reference to functions receiving a... (by JUAN DENT)
files in c++
 
hey guys i have 2 files ( students.dat and grades.dat ) students.dat : ID number followed by a first name then last name ( first and last name are 20 charac m...
[13 replies] Last: @kemort Eh, don't mind what @jlb said. After all, I'm learning from mi... (by Troaat)
by hale
Need help with TGA files...
 
Hey Guys, I need a help in opening the TGA image file, resizing to half of its original size and saving the reduced size. I am clear with using CV library...
[no replies]
by KJIII
Loop not compiling correctly
 
My loop is not working
[3 replies] Last: #include <iostream> #include <string> #include <iomanip> #include <l... (by gunnerfunner)
How can i improve this code? Cola Machine
 
So I was doing some exercise and cam across cola machine.. #include <iostream> #include <iomanip> #include <conio.h> using namespace std; void Mai...
[4 replies] Last: The tutorial on this site is very good: http://www.cplusplus.com/doc/t... (by AbstractionAnon)
Array and Char with function (1,2)
 
Hey everybody, Updated version(11.01.2017) I have to do something for Array() at Line 36 and I have to do something for CharAt( ) Li...
[36 replies] Last: Updated* ( Please check first post) Can I ask, I have to create and... (by mrbaki1)
custom iterator for a hash table
 
I am trying to build a custom iterator for a hash table. How can i make the ++ operator move to the next bin after iterating through all the elements in the lis...
[2 replies] Last: You've taken on a fair challenge here: (a) you need to first provide y... (by gunnerfunner)
How to overload a function in a header file ?
 
Suppose I have a main.cpp , //main.cpp //simplest form #include <whatever necessary> #include "header.h" int main() { type1 a1, b1; ...
[18 replies] Last: TheIdeasMan (4983) Your code compiles for me, you didn't include <st... (by quantatanu)
syntax question
 
Is this syntax correct? // return the number nodes size_t Capacity () const { size_t j = Size(); size_t h = Excess(); return j+h+2; }
[1 reply] : The syntax is correct if Capacity () is part of a class or struct. N... (by coder777)
Using empty macros for explicit intent/instruction
 
I've come to a point where, in some code, we have public class methods in core internal code that we want to express that is public for the core to use but shou...
[1 reply] : > I've come to a point where, in some code, we have public class metho... (by JLBorges)
by m1smr
Does a pointer pointed to nullptr need memory?
 
(text needed to post)
[6 replies] Last: http://stackoverflow.com/questions/13223399/deleting-a-pointer-in-c (by closed account 48T7M4Gy)
need help
 
srry bout that LONG code
[2 replies] Last: Bjarne 's comment as posted by gunnerfunner is the same concept as ... (by TheIdeasMan)
cin problem
 
Hi all! I've got a little problem: this is my code: int m; ... case 8: cout<<"\nVuoi calcolare a chi appartiene il minimo o il massimo voto di u...
[6 replies] Last: It does NOT work on ideone, you can see the output of the runtime erro... (by Computergeek01)
January 2017 Pages: 1... 7891011... 13
  Archived months: [dec2016] [feb2017]

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