Beginners - January 2014 (Page 5)

factors of 2 code
 
I keep getting a compiler error saying "invalid operands of types . . ." I'm trying to get the program to return the value of how many factors of 2 are in 12 (...
[3 replies] Last: Another way would be to cast the double to an integer static_cast<i... (by giblit)
Input not accurate
 
The output of this program is supposed to be "name" "grade". However when I run it I only get "grade". The name will never show up. I've tried using while (!...
[2 replies] Last: The input is a bunch of words. It could start with numbers, which sho... (by heroicJ)
by Sam99
I need just a formula
 
I've a problem. I need market price of a particular share; and I've these information: 1. Face value (basic price) of the share 2. Lot size of the share ...
[1 reply] : That is not a programming question. (by keskiverto)
String constructor and iterator
 
New to C++, and I'm not understanding this problem I've got: when using the code string text = "some words here"; string::const_iterator where = ...
[3 replies] Last: Fantastic! This is great help! (by gabrielh)
end() returns lvalue ?
 
Hi :) Could you please explain to me how the end() function from vectors is working ? I was expecting to get a l-value error when I wrote this : vector<...
[3 replies] Last: Thanks,you saved me again.It makes sense now :). (by Guzfraba)
Difference between i++ ++i
 
Is there a difference between putting the '++' before and after, or is it the same/ ++i; i++;
[2 replies] Last: Thank you for your quick response and the answer. (by closed account EwCjE3v7)
Expected unqualified-id
 
Hi, I'm having some issues with my code and I am getting some odd errors. #include<iostream> #include<cmath> using namespace std; int main() { cout << "Ent...
[6 replies] Last: Thanks CaptainBlastXD, works with your edits. Greatly appreciate all t... (by roycs96)
by venros
c++: numbers to text not working
 
Hi Guys, I cant get my numbers to text to work, i tried num/100, (num/10)%10 and i cant get the first digit from the left in a 3 digit number: ex: 123. If...
[4 replies] Last: Got it to work guys ty #include <iostream> #include <string> usi... (by venros)
by agure
VS C++ Windows Form HELP!
 
Greetings this is my first post i've searched long and hard on the web for an answer so i'm hoping you guys can help. I'm going to do my best to describe my pro...
[3 replies] Last: " windows form C++ " is actually called C++/CLI not to be confused w... (by closed account z05DSL3A)
by Alby94
Function's pointer cast
 
How to cast correctly a function's pointer? #include <iostream> using namespace std; typedef float (* MyFuncPtrType) (int, char*); typedef void* (*p)...
[4 replies] Last: It should also be noted that in this code, some_func is not a function... (by LB)
Typecasting Help
 
I am trying to get rid of this annoying error that keeps coming up when I pass a class object by reference in a parameter. The body of the code is this: Cont...
[8 replies] Last: Mikey, you sir are AWESOME. :D Ok, so I was able to correct the flaw ... (by jheard901)
by alsade
problem with initializing static class member
 
can someone plz tell me why does the function assign brings to a compilation error?? #include <iostream> #include <string> using namespace std; class String...
[6 replies] Last: The problem is that `String::s` doesn't exist. A class definition only... (by maeriden)
by xpg94
Overloading the + operator?
 
Hello everyone. I was reading about + operator overloading and I have a question. I understand the concept and everything is clear in this one: Cents o...
[6 replies] Last: The difference is that the const keyword prevents you from making ch... (by MikeyBoy)
by Ch1156
Can I use HTML or XML to make an UI?
 
I was wondering if i could use XML or some variant of it to make a UI in a window.
[1 reply] : Of course you could. As long as whatever UI toolkit you're using allo... (by Disch)
Storing the address to an array in a pointer
 
Hello, I'm having trouble understanding the relationship between arrays and pointers. Based on what I've read, arrays are syntax sugar for pointers and arrays s...
[3 replies] Last: oops, took too long to edit my post. no, it is an actual collection, ... (by Jaybob66)
Pointer to classes
 
So i was reading the Cplusplus tutorials for some recap on Polymorphism and I saw: Polygon poly; Polygon* ppoly3 = &poly; So im left wonderin...
[8 replies] Last: That still makes no sense whatsoever. (by Avilius)
Words in reverse order, string
 
Hello I'm trying to right a program that reverses the order or words in strings. The thing is I don't know how to do this. I only know how to reverse each lett...
[1 reply] : A first step might be to identify each individual word in the string. ... (by Chervil)
Problems to understand vector allocation
 
Hello, I am trying to understand the vector in 2D and how to print it in horizontal and vertical way but it seems I am doing something wrong and/or I am not ...
[4 replies] Last: i++ is just another way of saying i += 1 or i = i + 1 . So, if i... (by MikeyBoy)
by binso
Inserting a new node.
 
Hi. I am trying to insert a new node, but it isnĀ“t happening for me. Can you please look over my code. void insert(NodePtr& after_me, NodePtr& newNode)...
[6 replies] Last: It would be data which nodePtr1 will point to. nodePtr1 = createNod... (by binso)
by engr
what is the problem here?
 
Write your question here. #include<stdio.h> #include<math.h> int main(){ int x,y,z; float a,h; printf("Enter three sides of s triangle"); sc...
[4 replies] Last: it worked on OrWel DEV C++ but error on Turbo C++.. BUt After working... (by engr)
January 2014 Pages: 1... 34567... 44
  Archived months: [dec2013] [feb2014]

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