Beginners - March 2017 (Page 4)

by yorec
Help with integer array bubble sort
 
Hi, everyone, this is my first time posting here, and I was hoping to get some advice for a homework assignment I have. My assignment is to make a bubble sort a...
[1 reply] : num isn't initialized anywhere. not a major problem but its <cstrin... (by jonnin)
Program Question
 
I'm a little confused as to how I would write the end of the if statement for infinityNorm. This is a Euclidean norm program. For example, the Euclidean norm of...
[1 reply] : if (abs(v ) > largest) largest = abs(v ); They are doubles, not in... (by lastchance)
how to create a 3*3 matrix node in tree child?
 
i need to create a tree that has matrix 3*3 in every node like this 5 6 4 ...
[3 replies] Last: please look at this file https://goo.gl/mlx949 (by tjnapster555)
Input Question
 
Hi everybody, I am working on a class that takes the coordinates of two points and calculates the slope and distance between them. However, I would like to hav...
[3 replies] Last: As for the input, you could define an overload for the input operator ... (by Chervil)
Can someone help me overload operators?
 
Hi guys, I am supposed to create a program that can add, subtract, and multiply polynomials with constants or other polynomials. I need help overloading my arit...
[1 reply] : "Friend" is not needed for operators. You need to make the return valu... (by InsanelyNormal)
Why are we allowed to redeclare the same variable inside of a loop?
 
I know that if you declare a variable and then later in your code you try to declare a new variable with the same name you will get an error because you can't r...
[5 replies] Last: @keskiverto, @Peter87, thank you, I fully understand it now. (by idknuttin)
Functions using linkedlists not working as intended
 
I've just started using linkedlists and have run into a couple problems. I'm trying to write a practice program that lets the user add an element to the end of ...
[5 replies] Last: In a singly linked list, it's fast to add/remove items from the front... (by dhayden)
GoodEve guys!
 
hello guys.... how to do this PROBLEM... Write a program that prompts that user to select from a menu of operators, then ask the user to input two numbers and ...
[16 replies] Last: Hello nico144, If you are done with this give the topic a green check... (by Handy Andy)
Pointer and Dereference clarification and advice
 
I need some help in clarifying some points about pointers. In the example below is a short program, and a description of what each line does. Am I understanding...
[15 replies] Last: Hi volTron have you heard about smart pointer? :D if not this is wha... (by xxvms)
LU Decomposition not working?
 
So for one of my projects I need to write an algorithm for LU Decomposition, the only issue is that part way through the explanation the professor got himself c...
[3 replies] Last: The overloaded = operator etc. A 'simple' explanation is at http://co... (by closed account 48T7M4Gy)
Arrays
 
My program below is suppose to generate 10 random numbers ranging from 0-9 , and tally them up in index order, for example if i get three 0's, it should print ...
[2 replies] Last: wow such a simple fix , thank you very much (by persades)
Simpson's Method not producing correct results
 
Hi, everyone! I am trying to create a function that calculates an integral using Simpson's composite method but I am hitting a problem. When I run the progra...
[6 replies] Last: Another small point about Simpsons rule is it doesn't do much of a job... (by closed account 48T7M4Gy)
by const
Hash Table Segmentation Fault
 
Hello, I am working on a Hash Table program. It compiles, however it gets a segmentation fault. Any idea why? Thanks. #include <iostream> #include <cstd...
[1 reply] : Nevermind I fixed it. Problem was with my table initialization in main... (by const)
[Mode Function] Help needed
 
Hello Community! I once again hope for some help with the following problem. I have a function that should find the mode in an array. Here is my initial functi...
[14 replies] Last: Hello lastchance! My book, Chapter 9, (which is Starting Out With C++... (by Misenna)
Comparing vector elements or address?
 
I want to compare the actual object stored in the vector. I was wondering if this is comparing the address or the value of the object in the vector. The > opera...
[3 replies] Last: My apologies if adding () made it too difficult for you to read. It's ... (by kingkush)
Comparing vector elements or address?
 
I want to compare the actual object stored in the vector. I was wondering if this is comparing the address or the value of the object in the vector. The > opera...
[4 replies] Last: Looks like this was actually posted twice. I'm not sure how that happe... (by kingkush)
Changing space to nothing
 
I am reading in from a file and writing it to another file without white spaces. All i need to figure out is how to remove spaces. For instance, INPUT:Hello h...
[3 replies] Last: > I am reading in from a file and writing it to another file without w... (by JLBorges)
Help With Deleting Duplicates In Arrays
 
So I need help with deleting duplicates in my array. I have to delete one of the duplicates and print out the rest. ex. 1, 2 , 3, 3, 5 print out: 1, 2, 3, ...
[5 replies] Last: OP: and, of course, if you used any of the standard library containers... (by gunnerfunner)
by rantiv
Vectors and such...
 
My program is suppose to take in restaurant names into a vector and in one of the options print the vector, but for some reason mine won't print them. This is h...
[4 replies] Last: Gotcha, thanks man! (by rantiv)
The variable is being used without being initialized
 
Im using Visual Studio 2015. When i am running my code i am able to build the file and run it however after i enter in all of my variables i get this error m...
[7 replies] Last: @ test1234 Global variables are a bad idea. The OP did not have the... (by TheIdeasMan)
March 2017 Pages: 123456... 36
  Archived months: [feb2017] [apr2017]

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