Beginners - September 2018 (Page 18)

Merge Sort Algorithm
 
https://www.spoj.com/problems/PAIRS1/ Can we do this problem using merge sort algorithm. I have done this using binary search.
[4 replies] Last: I mean to say that in merge sort algorithm we make a merge tree we fi... (by rajharsh81070)
Any easy suggestions
 
I Am working on a cocos2d game, nothing big, just and entry for a contest. I am still in the drafting process. and I, similar to colour switch I, plan to add m...
[4 replies] Last: Oh, I know I said it is like angry birds, this is because a slingshot ... (by closed account 367kGNh0)
Arithmetic Mean Function C++
 
Hy ! I did a poor job today at exams with this function. Haw you will make a function from this simple code. #include<iostream> using namespace st...
[11 replies] Last: Everyone thank you soo much , i wasnt ON for couple days. I`ll look an... (by WalterCC)
c++
 
I began to write a code that displays even or odd numbers from random numbers. Write a program that tests the validity of the rand() function. Generate 10,000 r...
[3 replies] Last: #include <iostream> #include <ctime> #include <cstdlib> int main() {... (by JLBorges)
struct
 
first issue how i do fail the loop from calculating the company .pay when the hours or rate is negative. second are my return type for function prototypes oka...
[1 reply] : when the hours or rate is negative IF (hours is negative OR rate is ... (by keskiverto)
by Sodi
2D arrays
 
Hi all. I am a newbie in C++. I have always programmed with Matlab with lots of built-in functions. I have a Matlab code (mainly working with matrices) which ...
[17 replies] Last: Many thanks for the clarification, jonnin!. Now I can understand the r... (by Sodi)
Rookie question
 
How would I write a code that takes input from a user, then uses the letter they type to replace another letter already in the program. For example, I have a pi...
[7 replies] Last: We start with: #include <iostream> int main () { std::cout << " SS... (by keskiverto)
Use of unsigned int
 
I've been reading a bit on Googles coding guidelines, and while it may not be perfect for everyone or everything, I noticed they mentioned the use of unsigned i...
[8 replies] Last: I would agree with that. Unsigned is for bit logic and the occasion... (by jonnin)
string types not registering?
 
I'm a noob at this, and I'm learning, well, struggling, to learn headers/classes/etc. I really can't figure out what is wrong with the following code except tha...
[4 replies] Last: Hello eripiomundus, Thank you and you are welcome. Overshadows may b... (by Handy Andy)
by nirbh
unsigned and int
 
can someone explain to me this snippet: int i= -10; unsigned u= 10; std::cout << i + u << std::endl; // = 0 = -10 + 4,294,967,296 + 10 -4,294,967,296 Thank ...
[4 replies] Last: Your unsigned integer can represent values [0 .. 2^32) i.e. [0 .. 2^32... (by keskiverto)
by ionic
program that finds macros in source files
 
The program which should take file names from windows command line. c:\mac_find main.cpp chars.h the output of the program should print information like 1)tot...
[8 replies] Last: Here is a skeleton to get you started. #include <iostream> #include ... (by Thomas1965)
by Ch1156
no operator found which takes a left-hand operand
 
I'm getting an error and i'm not sure what it means, I'm trying to compare a value to a vector to get the right input, so if the player enters 2 it will get the...
[16 replies] Last: Furthermore, The << is a binary operator; it has two operands. T... (by keskiverto)
Reading binary file
 
Hello I was given an assignment that was to open a binary file with records. This is the the pseudocode BEGIN main Open the file Call the displayLogFile_binary...
[2 replies] Last: You could use use the read function of the fstream class. bool displ... (by Thomas1965)
detect mouse up or down
 
Hey, I am currently making an autoclicker that activates when the left mouse button is held down and stops when it is let go. The code used to activate the cli...
[1 reply] : Are you using any external libraries to detect mouse clicks? Can you p... (by H00G0)
calculate how many jellybeans can fit in jar
 
all my calculations keep coming wrong. I tried asking my teacher but no matter how changes I make the calculation keeps coming out wrong. I would greatly apprec...
[1 reply] : Your jellyBeanVolume will be wrong because of integer division: 4/3 wi... (by lastchance)
Help finishing a code
 
not sure how to finish the code.keep getting erros in the last line #include<iostream> #include<math.h> #include<conio.h> using namespace std; int main()...
[3 replies] Last: thanks a lot to both of you. it's fixed now :D (by hectorpenaloza07)
Search and display the comparison
 
I need help with the following question, I don't want the whole code but I really need help with this section. (DISPLAY THE NUMBER OF KEY COMPARISON FOR EACH SE...
[12 replies] Last: I can't see what you are still asking. (by jonnin)
converting char to ascii value then mod doesnt give correct output
 
So im trying to subtract two ascii value by first converting the chars to its ascii and then mod but its not giving the correct ouput. I am not sure why. Thanks...
[3 replies] Last: [quote=chang123]Is there a way to use the mathematical mod function in... (by lastchance)
Function or Variable
 
Hello people. I started learning C++ today. I am familiar with C so I directly began by studying Classes. In the classes tutorial is there a certain rea...
[1 reply] : Tradeoff. Design decision. The area is a product of the other member ... (by keskiverto)
Deleting a pointer that has been copied to another
 
My code now works, but I'm confused about the initial problem. Lets say I have an array of pointers, that I call new for. Next, lets say I copy one of those e...
[4 replies] Last: I'm at a loss as to why yours works, and mine doesn't There must be ... (by tpb)
September 2018 Pages: 1... 1617181920
  Archived months: [aug2018] [oct2018]

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