Beginners - May 2012 (Page 20)

by Dan Su
Error/Disable String Input
 
Hey guys, I just have a quick question. Say I have double years; cin>>years; How would I generate an error/ reject the input if it was a string. Thanks!
[2 replies] Last: Ah thanks, I think I can make something work with the !cin. (by Dan Su)
memory leak question
 
my confusion stems from not being clear on whether the leak lives within the program execution or outside of it as well ? my question is if i create a dynami...
[6 replies] Last: Considering most larger non-critical applications have at least few le... (by hanst99)
merging vectors
 
Is there a way I can form a new vector by merging VectorOne and VectorTwo? // Simple code to store courses using vectors and strings #include<iostream> #in...
[2 replies] Last: I don't seem to be able to combine my vectors though I've tried severa... (by vanessatse)
Compiler problem
 
I have a problem with two dimensional arrays. This is part of my code: const int NUM_CARS = 5; const int NUM_SPEEDS = 6; void getData(int noiseDataP ) { ...
[1 reply] : There's no 'k' there so this is the wrong function. (by hanst99)
by dnd123
Arrays with no set value
 
I am having trouble with arrays in my programming class. In the program I must create, I have to be able to make an array with no set number of spaces. IE: arra...
[1 reply] : int n; cin >> n; int* array = new int ; (by Moschops)
by IU1
Population program
 
Edited :)
[13 replies] Last: moschops - I understand. Sorry for any trouble. Shinigami - Thanks on... (by IU1)
█ Need Help
 
Hello, I wanted to output all even nos. between 1 and 20 inclusive , but what should i do ? i have no idea about this one Danish
[12 replies] Last: It's somewhat refreshing to see a different approach to solve the same... (by moorecm)
Assigning class objects to pointers
 
Hey guys...last project of the semester going on right now, and of course it has me totally stumped. The point of the program is to: -Open a text file containi...
[1 reply] : carPoint = carArr ; So, carPoint is a pointer to a car object, bu... (by Moschops)
Kth Value
 
What iS meant by the kth value?And Any one could help me about how to solve the question given below? Write a function int digit (int num, int k) that retu...
[1 reply] : What iS meant by the kth kth means first or second or third or four... (by vin)
by dale
Assigning data from file to matrix C++
 
Good day everybody, I'm beginner on C++. The aim I want to achieve is quiet silly. But I don't see/understand where is the mistake. I will be very thankfull ...
[1 reply] : Well there is a laundry list of small, easy to make errors here. Since... (by slider57)
password input (1,2)
 
Hi :) I was trying to figure out, how to mask password input with '*'. And I found this: #include <iostream> #include <conio.h> using namespace std; int...
[20 replies] Last: ok sweet :))) I started using Xcode for mac, and it's working nice :) ... (by justinko)
by Grax
need help in getline() and cin
 
i need a way to get input on string type which include spaces, and below code is what i have done. #include <iostream> #include <conio.h> using namespace ...
[6 replies] Last: that's what i exactly need! thanks for the explanation! thanks for all... (by Grax)
Get all text after point
 
So i want to get text after a point. I get text form a txt file like this string filename = "C:/Users/Tim/Desktop/Folder/Documents/Programing/C++/New Folder/A...
[17 replies] Last: anyone please? (by sherlock)
pointers
 
I think my code works properly but can I just double check with you guys to see if I've used pointers and functions correctly? And if there's any recommendation...
[2 replies] Last: Thank you for your quick reply.The corrections were of great help. (by vanessatse)
by Jiksy
Find highest and lowest marks
 
Hi, I'm a complete new beginner in C++. I have bee tasked to create a console app that extracts data from a text file. The text file consists of Student ID's, ...
[5 replies] Last: Thanks a lot Moschops... I understand that part better now. 1) I now... (by Jiksy)
What's wrong with my coding???
 
My coding won't read next person in the data file. It's only read, calculate, and print out first student in the data file.Please tell me what i did wrong on my...
[2 replies] Last: The first thing you want to do is clean up your code like this int ... (by TightCoder)
Getline makes you enter phrase twice
 
When I use this code: int main() { string house; char found; getline(cin, house); cin.ignore(); found = house.find("storage...
[3 replies] Last: Because of this: cin.ignore(); (by Moschops)
Help needed "hotel management program"
 
#include<iostream> #include<stdio.h> #include<dos.h> #include<string.h> #include <cstdlib> #include<conio.h> #define max 100 using namespace std; //C...
[1 reply] : I made like comment, because the program can work like that . (by bardhi232)
by Ch1156
Cant understand Referencing
 
I have been looking at referencing (& symbol) and i cant seem to figure it out, in my code i want to get the plrname and scname from MAINPROGRAM so i can save t...
[9 replies] Last: also can i use a struct for the variables instead of a vector or an ar... (by Ch1156)
can someone help me finish this code.
 
well im having a hard time with this code. mainly because of the pointers. i know what i need to do but its hard for me to translate it to codes. so i hope some...
[10 replies] Last: Not entirely useless. A few more codes and you could turn it into a bl... (by slider57)
May 2012 Pages: 1... 1819202122... 59
  Archived months: [apr2012] [jun2012]

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