Beginners - November 2014 (Page 15)

by markat
Stuck on creating a separate function for bubble sort
 
...
[5 replies] Last: Oh you're right, that was careless reading on my part. I'll change the... (by markat)
Help with simple (I think) function
 
Hey, I'm trying to write a function that will return the value before x in a linear equation, note: the user will always input it as such: 34x + 5y + 1 = 0, so ...
[4 replies] Last: I actually get 0 warnings :) But I am saying you should have had mo... (by TheIdeasMan)
How to get the index number of an element into an array?
 
I tried to use find() function but it returns the element not the position. int ar ={1,2,3,4,3}; int *l; l=find(ar, ar+5, 3); cout<<*l<<endl; i...
[2 replies] Last: Yes. find returns an iterator to that position. To get the index,... (by shadowCODE)
by Scizor
Binary Search Issues
 
Hello! So below, I have a piece of code that is part of a hangman game. What I am doing is asking for a guess, storing each guess in an array, and then trying t...
[no replies]
Dividing into rooms
 
I trying to write some code which able to detect rooms in a map. The map is represented in an matrix as in black/white pixels. Part of the map looks like th...
[no replies]
True Object Oriented Programming
 
Hello all, I've been learning c++ and have gotten fairly comfortable with many of the concepts, to the point where I can write some decently complex code (at le...
[11 replies] Last: everyone has his own learning strategy. you read 130 pages in two days... (by anup30)
by KMagic
Convert char to int
 
I have googled this basic problem and find this solotion fastest: char a = '4'; int ia = a - '0'; Does the phrase "" a - '0' " have a particular ...
[4 replies] Last: Got it. Thank you very much. (by KMagic)
help me with classes pls
 
Can someone send me a tutorial where I can learn about classes, objects and constructors? The professor will talk about about these topics this upcoming week ...
[2 replies] Last: Made a thread about the concepts the other day. http://www.cplusplus.c... (by d1ff1cul1010)
Double Factorial without recursion, just a while loop
 
I've got a very specific homework problem I am working on. I am supposed to find the semi or double factorial of any given positive integer. My program works fi...
[1 reply] : I'd try something like this. Note: It still breaks on the odd numbers... (by killingthemonkey)
by Pet124
Saving and Writing to a txt file
 
I'm trying to create an inventory program that you can save the data and open it again. But every time I run the program again my txt file empties so it's blank...
[3 replies] Last: follow the link I've given. and use fstream object to read and write s... (by anup30)
Is this a decent example of using virtual functions?
 
(Sorry if this is considered a duplicate) I am trying to understand "polymorphing" and so far, the code below is what i have managed so far. Please correc...
[4 replies] Last: Thank you so much! i finally understand polymorphing! (by SomeAmazingGuy)
Arrange 3 variables in descending order using swap
 
I'm having trouble with this project. I've been trying to get this code to run and have been greeted with the same "The system cannot find the file specified" e...
[4 replies] Last: That all worked very well!! Thank you so much for your help! :) Here ... (by nlundstrom)
by wolfv
Mysterious result from sizeof(array[]) in constructor initialization list
 
In the following example sizeof(ar ) is taken twice for the same array. First in main, where the result is correct. Then again in the Row class constructor in...
[2 replies] Last: Thank you again JLBorges. (by wolfv)
by xsxsux
variable is used without being initialized
 
when I debug this in my MS Visual Studio, I get a message saying variable is used without being initialized, could any1 take a look at what's wrong with my code...
[5 replies] Last: OMG!! Thank you very much! It works perfectly :D:D:D (by xsxsux)
Compiler Error Help
 
EDIT : Figured it out. Wrong spelling on one of them. So I have 2 void functions. The first void function compiles without error but the second one doesn't. Th...
[no replies]
Program finishes at second cin
 
Hey guys, can you help me with this problem I'm experiencing, when I execute my program it stops after 2 cins, that means it won't let me input line and equatio...
[3 replies] Last: i think its because you are trying to enter strings on the first cin w... (by xenovia12)
Question about char to int from a text file
 
Hello, I'm having a little trouble with this checkbook program and taking the string from the text file and assigning the string to an int and performing a ma...
[3 replies] Last: Thank you both for the help, I haven't quite solved it yet but I'm a l... (by foxtrot1013)
No Suitable Constructor Exists
 
I am getting this error message and so far it's the only error in my program which is a game. I am hoping to get some insight as to what to do as this is quite ...
[4 replies] Last: Thanks for looking that over!, ill work on it this weekend . (by JoJodoggy1)
Phone Number
 
I am doing a program for homework and am having trouble asking the user if they want to enter another number. Here is the question: make telephone numbers e...
[no replies]
Bulls and Cows game
 
Hi, I'm reading this book Principles and Practice using C++ and I'm a total beginner(only about a month), I finished this exorcise on chapter 5, just wanted to ...
[no replies]
November 2014 Pages: 1... 1314151617... 65
  Archived months: [oct2014] [dec2014]

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