Beginners - July 2011 (Page 2)

Halp
 
I made a selection menu through text for an rpg, and need a way to say, - if the input the user gave didnt match the list of possible inputs, "error", and loop ...
[1 reply] : A simple input validation loop : while( true ) { string in; ... (by hamsterman)
executing a function by user input???
 
How would you have a function execute only by the user inputing specific characters (like info) anywhere in the program, regardless of what function was current...
[1 reply] : You could append if( my_input == "info" ) do_stuff_with_info(); to e... (by hamsterman)
Constructor Question
 
I'm working on an assignment involving double-end queues (a "deque") within a template class and am a bit confused about creating the constructor. Each deque o...
[8 replies] Last: Sorry I didn't see it but the constructor prototype you were given is ... (by closed account D80DSL3A)
How to make an if state,ment activate if you put any letter
 
I'm wondering how to do this? PLease help By 'put' I mean type when using the program
[1 reply] : just trying to help. char select; . . . printf("Do you want to en... (by marklycris05)
How to swap the value?
 
Good day everyone. I just want to ask a very simple question, how to swap the values of the two variable without declaring another variable? Example: int a=3...
[10 replies] Last: thanks for the help .. i have also thought about this method, a=a+b;... (by marklycris05)
by wraith
"no match function for call to 'count'
 
So for some reason in this program: main.cpp: #include <iostream> #include <vector> using namespace std; vector<int> highs; vector<int> lows; vect...
[2 replies] Last: That worked. Thank you, don't know why I didn't see that. (by wraith)
by Gene
Function not changing contents of Vector
 
Is it because I need a pointer to it?
[11 replies] Last: Ok, I removed that line and its working now, must have been really tir... (by Gene)
Head pointer null values
 
I have a doubly linked list, that I am working on function to clear the list, but it winds up in an infinite loop because the head pointer is supposed to be NUL...
[2 replies] Last: That was it. I didn't see that when clearing the list, of course head... (by joatmon)
by fram
Input file format problem into array of structs (1,2)
 
So for my assignment there is a state population data file in this format for all 50 states (spaces included) Idaho Boise ...
[21 replies] Last: Thank you sloppy 9! (by fram)
by KSmith
Undeclared Identifiers
 
I am attempting to write a program that allows the user to add,remove, and display all songs in a playlist. I am new to programming and I am getting errors that...
[7 replies] Last: Are you on the same course as John? (by andywestken)
returning arrays in function problem?
 
#include <iostream> #include <string> using namespace std; //fucntions void intro(string name ); int main() { string name ; int subName; ...
[3 replies] Last: i am just trying to put everything in main into a function #include <... (by metulburr)
Template Function Call
 
I'm having trouble getting this function call straightened out. It's part of a doubly linked list set up in a template. I'm getting a "no matching function ca...
[6 replies] Last: It works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!... (by joatmon)
by Savale
Create header file for string function
 
Hey guys I have a function that returns a string fine on its own, but when I create a header file for it and try to compile it gives me an error in the header f...
[5 replies] Last: Okay makes sense now thanks (by Savale)
by StrucK
sorting structures
 
I am trying to sort a list of students by their ID numbers in ascending order. Along with their IDs are program and test averages. I have used a struct to hold ...
[3 replies] Last: Use the sort algorithm, #include <algorithm> bool student_id_asc(... (by closed account DSLq5Di1)
determinants
 
Alright i'm writing a program using 2 seperate functions det2()and det3(). The function det2() is supposed to calculate the determinant of a 2X2 matrix. Then ...
[2 replies] Last: QNAN = Quiet Not a Number NaN = the value of a calculation couldn't... (by andywestken)
How to make 4 LED blink randomly?
 
Hi. I need help. How can I use a c++ to program 4 LEDs to blink randomly using a 18F4550 micro controller? I already designed 4 individual LED circuit and each ...
[1 reply] : You are probably better off asking that question in a micro controller... (by eidge)
headers problem
 
header.h file #ifndef HEADER_H_INCLUDED #define HEADER_H_INCLUDED #include <iostream> #include <string> using namespace std; void prompt (string name...
[5 replies] Last: Yes @ the header file needs to be saved as the name that's included in... (by Albatross)
prime number generator
 
I have just started learning c++ in the last week and have been having a ball with it. I am, however, having difficulty with a simple prime number generator th...
[2 replies] Last: holy crap... I knew it would be some tiny detail that I mixed up. It ... (by sparko10)
by tonnot
How to cast betwen vectors of objects ?
 
I have two structs and two vectors struct A { double A double B }; struct B { A my_A double C }; vector<A> vector_of_A vector<B> vector_of_B ...
[7 replies] Last: Sorry, by "vector" I was referring to the two classes, not the std::ve... (by andywestken)
by zbg935
Beginner Help
 
Hi guys. I just started to learn c++ yesterday. I use a mac computer. I have CodeBlocks and Xcode,but I have no clue what to do. I not exactly sure whate ach pr...
[4 replies] Last: These videos should help you get started with c++ http://www.youtub... (by wtf154)
July 2011 Pages: 1234... 54
  Archived months: [jun2011] [aug2011]

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