Beginners - February 2013 (Page 55)

Merge Sort C++ Compile Error
 
I'm trying to implement a merge sort function and I'm getting a compiler error that says "no match for 'operator=' " It occurs on my recursive assignment of lef...
[1 reply] : you know that in : left_list = mergesort(left_list); vector<int> can... (by dandy)
What is wrong with this help?
 
When I type 64 for input I get the correct results expect for the last else, ("Sorry not divisible by anything!") I get it every time! I do not know how to make...
[9 replies] Last: You should not post the same question multiple times. Keeping your qu... (by AbstractionAnon)
about --n
 
Can any briefly tell that the difference between --n and n-- another thing n=5 while (--n>0) {if(n==2) cout<<n; break; } cout<<"endloop"; what wo...
[2 replies] Last: --n means decrement n before using it in an expression. n-- means dec... (by AbstractionAnon)
Trouble with if-else statements
 
I'm making a program to compute hourly pay. If you work less than or equal to 40 hours your pay = 12 per hour. Every hour after 40 hours you earn $17 dollars ...
[5 replies] Last: Your else isn't supposed to use a condition. What you're trying to sa... (by swigganicks)
insertion sort printing out strange values
 
I created an insertion sort and it runs alright but instead of printing out the numbers I entered it prints out a strange string of numbers that make no sense. ...
[2 replies] Last: thanks Zhuge is that the reason I'm getting the strange numbers? it's... (by ApacheOmega)
error: conversion from 'Multiplication*' to non-scalar type 'Multiplication' requested
 
I am trying to finish a program that calculates a simple multiplication using addition and recursivity. I.e 3 *4 = 3+3+3+3 So I have made a class as f...
[7 replies] Last: Just one more - now I see how you're using it, you don't need the loop... (by jim80y)
by Dzoni
Initialization of static array
 
Hi, how should i do initialization for static array in H file i have static IVTEntry *entries ; and in CPP file i should have something like this IVTEntr...
[6 replies] Last: IVTEntry* IVTEntry::entries ; //zero initialized if global void* foo ... (by ne555)
help me understand why i get this error
 
The hang up im having comes from trying to use a for loop and a function to read in values for the enrollment data of the struct ENROLLMENT this is the error...
[3 replies] Last: thanks for the responses you guys. Program is on track now. That whole... (by byronflds)
While Loop
 
How do I prompt the user to enter an integer from the range 50 to 100 and use a do while loop to repeat the prompt if the value inputed is outside of the rangw?...
[2 replies] Last: C++ does not recognize the kind of statement you are writing in your c... (by Zhuge)
by Scrub
Random number fun.
 
So I am a bit bored, and I decided to make a nice easy game of "mastermind", a game where you have to guess 4 numbers, in the correct order. After a select amou...
[5 replies] Last: this function make random number between min and max value and print i... (by Sadegh2007)
Deleting from singly linked list(only problem in code)
 
Most of my code seems to be okay, I can insert integers into my list and print it out fine, but something about my logic in my deletion seems to be horribly wro...
[4 replies] Last: That worked like a charm. Here is my really bad unoptimized finished c... (by GrizzlyMatt)
my strpbrk
 
hi guys. this is an example of 'for' and 'while' using together i'm beginner in C/C++ if it's better way please tell me for see original strpbrk go to here: h...
[2 replies] Last: but i like use two leading underscore in my function or classes it's m... (by Sadegh2007)
Simplifying radicals
 
I seem to have trouble for either finding a descriptive piece of code, or finding a description of how to simplify radicals. I plan to use this as a separate fu...
[no replies]
Is it good to have pointers for majority of variables?
 
Apparently pointers are super handy in increasing compilation speed because there isn't the need to search for each variable one by one, just knows the address ...
[4 replies] Last: @firedraco I read that when your program searches for a referenced va... (by firedraco)
by Ch1156
Converting string to pointer (1,2)
 
I was wondering how do i convert this string to pointer #include <iostream> #include <string> #include "_Header.h" using namespace std; void passbyreferenc...
[20 replies] Last: [quote=Ch1156]i though you only used the delete keyword when you use n... (by MrHutch)
by Camoph
Help with pointers and arrays, please! (1,2)
 
Hi all. I'm learning c++ by myself, and right now I'm working in a basic problem of arrays. I want to create a code that multiplies matrices. I wrote the cod...
[21 replies] Last: Thank you for your help. I will work on it. (by Camoph)
Question about if statements
 
I have searched around and I am apparently not searching for the right thing. My question is, can you put an if statement within an if statement? For exampl...
[1 reply] : You can definitely nest if statements. The only reason the second one ... (by WhiteWind)
Advice on a String Program?
 
I've never coded before, and I'm taking my first intro to C++ class. I'm just going to admit that this is a homework question. I'm not asking for the solutio...
[6 replies] Last: Thank you, L B and simpleasy. That worked! I appreciate it. I have a f... (by JacobNoob)
Why am i getting this error referring to asserts?
 
So for college we got a programming project where we have to find the values of a vector and part of it is finding the min and max value so i created a little ...
[3 replies] Last: sizeof(v) is NOT the size of the vector. It is the size of the cla... (by LB)
Entering name
 
Hello am talking a introductory class on C++. in the lab we have to write a simple piece of code that will ask the user for there name and age. i was able to wr...
[3 replies] Last: When you write cout << "Enter You First Name Please: " << endl; cin ... (by SamuelAdams)
February 2013 Pages: 1... 5354555657... 67
  Archived months: [jan2013] [mar2013]

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