Beginners - March 2012 (Page 53)

by azaaza
type casting problem
 
1 struct Foo 2 { 3 }; 4 5 struct Bar 6 { 7 }; 8 9 10 int main() 11 { 12 Foo* f = new Foo; 13 14 Bar* b1 = f; 15 Bar* b2 =...
[1 reply] : Types pointed to are unrelated It tells you why. (by cire)
by Ken777
Display all the prime numbers between 2 numbers
 
#include <iostream> #include <ctime> #include <cmath> void primeNumbers (int num1, int num2){ //find the prime numbers between num1 and num2 ...
[10 replies] Last: Yes except that question was asked properly. Ken777, it is extremely o... (by Krahl)
"Hybrid :why should I have one?
 
If this was a golf forum, I'd love to answer you. Alas, it is not
[no replies]
Unchanging variable
 
I have a struct with one value and one function, struct item { int mod ; void set (int kA, int kB, int kC) { mod =kA; mod =kB...
[3 replies] Last: Thanks, I just noticed the wrong array size, and now it works like a c... (by surrealife1)
by mowali
Strings help!
 
*/ Would Someone please help me on this? I will work on it but I just want to make sure I am doing everything right. Please let me know. THanks... btw for som...
[no replies]
Help with Program
 
Hey guys, I am having trouble calling an array...here is the code. What I'm needing help with is how to have the value of ttc (ten thousand count) return the...
[10 replies] Last: I agree with L B. There is probably a newline in the stream. The probl... (by Krahl)
_findnext() not working properly
 
I'm trying to get all the files in a directory with the same extension. Eventually _findnext is called and set errno to ENOENT which equals 2. When debugging, t...
[2 replies] Last: Thanks, working now. (by snipslog)
Error showing up and no clue what it is referencing: symbol(s) not found for architecture x86_64
 
I'm new to c++ and am using Eclipse on my Mac osX. This error (below) has come up and I have no idea why. Can anyone help? Is there something wrong with my co...
[3 replies] Last: Wow. I feel like an idiot. Thanks for your quick responses guys! (by iolement)
copying source code from a directory
 
Hi, I took a programming class a few years ago (C++) and have since forgotten everything, even the most basic stuff. I just got assigned my first programming...
[no replies]
missing ; before identifier, and int assumed c++ does not support int
 
I have an instance of a class in this 'cpu.h' and it is from 'ir.h' it worked like this for a while and then just went crazy with errors, nothing looks out of p...
[1 reply] : If, in a translation unit, "ir.h" is #included before "cpu.h", then ... (by shacktar)
Simple program giving solution of -0?
 
Why is the program giving me a solution of -0? The program is simulating the slope formula between two points. I never had a problem like this in Java. Here ...
[4 replies] Last: program is working fine now, thanks guys. (by yosimba2000)
load.eof() = 1 at beginning of file
 
I have some code that is supposed to transfer all the code from one text document to another, but replaces certain strings of characters with another. I've che...
[9 replies] Last: Thank you. I didn't think of any of that before as I have not come ac... (by GRex2595)
unresolved external error
 
Hey guys, I'm about 2 months into c++ and I've written a fairly simply code for the High Low Game in which the system generates a number and the user has to gu...
[4 replies] Last: Thanks guys (by dheredhere)
Include al the dlls in the exe.
 
I'm using MVC++ 2010 and I find it irritating that every time I send someone a project I have to include msvcp100.dll msvcp100d.dll msvcr100d.dll in th...
[3 replies] Last: Build in Release mode and this is done for you's. (by LB)
ERROR: 'Deck{ctor}' cannot have a return type
 
When trying to build a solution in MSVC, I keep getting this error, and I can't figure out what's wrong. I've looked and looked, but can't find any signs of a r...
[11 replies] Last: @modoran: Where are the memory leaks, exactly? I thought that the dest... (by atropos)
by Eyes
Coin Toss Game: Improvements / Feedback?!
 
Hi guys, This is the first program i have written myself, so be gentle :) Its just a basic coin toss game, where the user guesses each toss, and they get ...
[7 replies] Last: @Eyes I'll be happy to answer any questions you have on the program a... (by whitenite1)
do while issue
 
Hi I'm working on a class project and am having a little bit of an issue with a do while loop... int _tmain(int argc, _TCHAR* argv ) { string optionS...
[4 replies] Last: Got it, thanks for the help :) (by Hydrasin)
array of char into int (again)
 
Hi, I cant use pointer or atoi. I know there is a method with a value*10 and a loop .I did nt find it anywhere ... if someone can explain it again or show ...
[1 reply] : I think the point of the assignment is for you to figure out the metho... (by Zhuge)
Set struct value
 
Is it possible to have a struct with an initial value? For example: typedef struct theatre{ string showName; int stallSeats; in...
[1 reply] : No, not like this. You need to make constructor, like in class. As str... (by Shinigami)
char* to string
 
How do you convert char* to a string. I've tried so many ways but I keep getting errors. I need convert them so i can combine the strings for a function. cha...
[8 replies] Last: With char arrays: char buffer3 ; // note buffer3 must be large eno... (by Disch)
March 2012 Pages: 1... 5152535455... 71
  Archived months: [feb2012] [apr2012]

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