Beginners - January 2015 (Page 16)

Doubly-Linked Lists
 
I am writing my own doubly-linked list class. I was wondering if my code looks correct. #include<iostream> using namespace std; class DoublyLinkedLi...
[1 reply] : One way to check is to modify your displayList function to test if the... (by ats15)
Can someone explain me how this program works?
 
Write your question here. I have been watching a series of videos to learn c++ and this program was the final project. I was totally lost. It is suppose to...
[6 replies] Last: Is there an easier way to do this? using pointers? These are unteste... (by dhayden)
random number generator
 
Hello, Im fairly new with C++ and i was wondering you all may be able to help me with this programming question. i need to generate N random numbers between ...
[1 reply] : Check this other thread out, see if you see anything useful. http://w... (by YodaCode)
How can I use cin to input a space to a char?
 
Is there anyway that I can use cin to pass a whitespace to a char object? For instance, as in the code shown below: #include <iostream> using namespace s...
[3 replies] Last: To MiiNiPaa: Get it. Really Appreciate it. To DyavolskiMost: I'm aware... (by glenjoker)
Losing my mind (while loop)
 
This is array and loop practice and I cant seem to figure out what is going wrong. I have everything working in my while loop until I introduced the int pref as...
[1 reply] : I think this will help you out a lot. https://www.youtube.com/watch?v... (by YodaCode)
Bug in game
 
This is part of my program i'm creating, i have a bug I can't figure out. When I go to the "Create" part of the if else statement, and enter a skill, then a amo...
[8 replies] Last: That was it, I changes it to std::cin >> input. Thank you for that... ... (by closed account 3R5fjE8b)
Matrix Route Algorithm
 
Matrix Given a matrix A ‘mxn’ with numbers 0 or 1. Write a program that finds a way from the top row to the botton one by following the neighbour '1'-s. Two...
[1 reply] : perform a flood fill on each cell of the first row, check if at least ... (by ne555)
by Jaycoh
Help with multiples of 3?
 
Hi everyone. Ive had some trouble with this weeks practice assignment. Basically, we are supposed to write a function that will print a char symbol '*', for eve...
[3 replies] Last: @MiiNiPaa Thanks Alot! That really helps. it makes sense that in orde... (by Jaycoh)
Any shortened version of this code?
 
Is there any way to shorten the while loop? Maybe through use of an array or maybe something in the C++ library? char choice; while (choice != 'a' && c...
[2 replies] Last: That's so simple. I cant believe I didn't think of that! Thanks. (by DoomyNY)
Is it possible to use a dynamic c-string instead of a []
 
Disclaimer: this is for a linked list for homework, as you can see this is just a tiny aspect of a larger problem. I am not asking for anyone to help me write t...
[1 reply] : I think I solved it. char *name2 = new char[b_item.getNameLen(... (by Bdanielz)
Problem About Struct!
 
I have to design a struct that holds names, ages and a pointer to the struct itself For example: struct couples { string name; int age; couples *spouse; } I ...
[1 reply] : comment your code stating your intentions. explain why do you think th... (by ne555)
by Kernul
Improving the code
 
Is it possible to improve this code? I did it with the help of my friend and it works fine but I'm not so sure about the use of the struct in this case. Is the...
[11 replies] Last: Okay! Thank you so much! I'll mark this thread as solved. (by Kernul)
while loops not working?
 
anyone see whats wrong? It just displays hey there sean 100000000000 of times XD Now i removed the ; on my while its an infinite loop? #include <iostream> #...
[3 replies] Last: As Peter87 says: x =+1; This is actually: x = +1; , which is the... (by Disch)
by ntran
Multiple function definitions
 
Hi everyone, I have a cpp file with my main function. At some point it calls for functions which I have declared in another cpp file. Example: main.cpp...
[6 replies] Last: Thank you to everyone, I learned something new today. (by ntran)
Where is the file?
 
WARNING : The problem stated here is extremely noobish! I have created a blank CPP project in visual studio. It should create a file named pt_data.bin at D:\...
[2 replies] Last: The default mode is ios::in | ios::out, when you specified the mode as... (by tipaye)
Usin *this with Class and Class&
 
Can someone approve my theory. If we use *this with function Screen &Screen::move(pos r, pos c){ pos row = r * width; cursor = row + c; return *thi...
[2 replies] Last: Thank you! (by jakvrh1)
by sha92
How to get a double value when I devide two integers????
 
Hello, In my program I need to get a double value when I use the findValue function. But I end up getting an integer value instead. Please help! #inclu...
[3 replies] Last: That works! I never knew this. Thanks so much! (by sha92)
calculator problems
 
I just started to make my way in c++ and i'm trying to build a calculator. everything is working fine except my "if" and "else" in case 4. it would be nice if ...
[5 replies] Last: wow thanks for the fast reply and help! (by count4zero)
Vector element
 
Hello, I decided to move on with the exercises so here is one: Write a function that finds the smallest and largest element of a vector argument and also...
[12 replies] Last: void gsl_vector_minmax (const gsl_vector * v, double * min_out, dou... (by pacman169)
Please give me some codeadvice ?
 
hello, Is match.pathKey.count() calculated once, or will it be calculated every time the loop runs? for(int i =0;i<(match.pathKey.count());++i) ...
[9 replies] Last: > How can one make such a listing GNU, LLVM -S http://gcc.gnu.org/... (by JLBorges)
January 2015 Pages: 1... 1415161718... 39
  Archived months: [dec2014] [feb2015]

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