Beginners - November 2012 (Page 55)

Basic Palindrome
 
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ string words; cout <<"Enter words : " ; getline( cin,words ); ...
[9 replies] Last: do you know that reverse exists in the std: http://www.cplusplus.co... (by coder777)
by abry
C++ String Search
 
I'm making a program where a user will input his string and then there's a thing where you could search a word or phrase from the string. Here's my code: if ...
[1 reply] : You should use function strstr instead of strncmp (by vlad from moscow)
Basic Arrays question help please!
 
If i were given the following array numbers with the corresponding values: index:0 1 2 3 4 5 6 7 8 value:1 3 5 7 9 11 13 15 17 how would I calculate u...
[4 replies] Last: Thanks got it now........... (by leonelui)
Passing arrays to functions. Why won't this work!?
 
/* By: Jacob */ #include <iostream> using namespace std; int descend(int *, int, int); int main () { int num ; int awn =1; int x=0,i=0,t=0, a, b, c, size...
[4 replies] Last: Well let me ask you this, how would you turn that bubble sort code int... (by Def Muse)
Check only 1 character input
 
#include <iostream> #include <string> using namespace std; int main(){ char thechar; string ErrorMsg; bool isFalse = 0; cout << "Enter char ...
[4 replies] Last: i just try with some simple code . err . yeah. im using visual c++ 201... (by Felicia123)
by john22
Priority_queue question
 
Hello, I have seen this single line code priority_queue <int, vector<int>, greater<int> > pq; which inserts integers into the queue and the lowest integer...
[2 replies] Last: This site's tutorial actually has a section on operator overloading wh... (by Zhuge)
Input not accepting "1E6"
 
Hello. I am working on a project and I cannot seem to get this to work. I am having the user input the final frequency and for the "test" values my teacher ga...
[4 replies] Last: Does it work if you separate the cin statements? cout << "Please e... (by TheIdeasMan)
[Really simple problem] Loop condition not working?
 
int cont1=0; char agenda = {{{999}}}; int contprincipal=10; char nome ; cout << "Seja bem vindo!" << endl; while (contprincipal!=0)...
[1 reply] : What does the rest of your code look like? Not sure why you are using ... (by Raezzor)
Making a game with a 1D Array (1,2)
 
I have to make a tic-tac-toe game with a 1D array. I was told to make the array type char. This is my code so far void get_input (char ); void ...
[21 replies] Last: You have to declare any variable you use! If your function receives wh... (by drognisep)
header files inside header files
 
Hi, I'm getting quite confused on which ones need what, so I include all header files in every single file, (.cpp and .h). is this okay? I suddenly th...
[1 reply] : Yes that is potentially problematic. See section 6 of this article fo... (by Disch)
Help?
 
#include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; string ace; string two; string three; string four; ...
[no replies]
how to call a boolean function into main
 
I don't know how to call the Boolean function back into main. I'm trying to make a tic tac toe board. The program works but doesn't stop when someone wins becau...
[3 replies] Last: mjr5253, were you able to find your problem? (by molecularman)
Tic Tac Toe
 
I have to write a program simulating a game of tic tac toe this is what I have so far but I am having trouble implementing the rest of my functions. Any help is...
[1 reply] : http://www.cplusplus.com/forum/beginner/84101/ and http://www.cplusp... (by drognisep)
Optional cin
 
Hello, I'm trying to do a simple calculator in c++ and slowly expand on it But, at the moment I'm stuck. My code reads: #include <iostream> #include <cmat...
[3 replies] Last: Try using a bool type variable. Create an if statement that states th... (by closed account EAUX92yv)
Need helping determining a return statement
 
Hey everyone! I am almost done with this program, but I am unable to determine what one of the functions returns outside of the 'for' loop. The specific plac...
[4 replies] Last: Ah thank you much kind sir/ma'am! :) (by Merriak)
User defined function returns unexpected value
 
Hi, i'm new to programming and don't have much experience, but have decided to take a course at uni. We've been doing user defined functions and have got stuck ...
[2 replies] Last: Thanks, i knew it would be something simple, but i just couldn't find ... (by saxonishere)
Need another set of eyes
 
I have been working on this project for 3 days and I just can not figure out how to solve these errors, was hopping someone could help, here is my code and my e...
[9 replies] Last: Thank you for everyone's help so much! (by GoPredsGo)
Encapsulation/Incorporation
 
Hi All, I am having a little trouble wrapping my head around something my professor said, I am hoping someone can help my brain click. He said that encapsula...
[5 replies] Last: Ok, next question is how is the best way to implement the get/set func... (by dudeman007)
cin reading multiple words
 
Hi everyone, I know this is asked a lot, i've looked it up and found several answers to my problem, but it just won't do. The code looks like this, i'll expl...
[6 replies] Last: Well, like is explained in detail in the post I linked, the operator>>... (by Raezzor)
Another infinite series
 
I should print 0, 1, 3, 6, 11, 19... I'm told "where a1=0, a2=1, a3=(1+a1)+ (1+a2) and a(n)=(1+a(n-2))+(1+a(n-1)) I seriously haven't any idea how to ...
[1 reply] : never mind, I didn't realize that it was just the Fib sequence minus 2... (by bowlbase)
November 2012 Pages: 1... 5354555657... 75
  Archived months: [oct2012] [dec2012]

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