Posts by 1o0oBhP Contributing to Articles being Marked Solved
Just a few for you
cstr() ' convert to string
ccur() ' convert to curreny
clng() ' convert to long
cint() ' convert to integer
cdbl() ' convert to double
and theres probably a few more if you google search!
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
not tried cstr() ??
then use listbox.additem method
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
use a while loop checking if q is pressed. You havent actually used char, and are asking the user to input a letter or number, but only grabbing the number! I would convert to c++ and use iostream, I dont know the C equivalent
char input; // user will type, so input is a char!
while (input != 'q' || input != 'Q') // loops untill you put q or Q in input
{
code here...
I would use cin >> input;
then a strtoi (i think that is how it is spelled) call to convert the char to a number
}
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
athlon 64 (non fx) is DEFINITLY better value for $ by far - and its performance is still blistering for HL2 and any other modern games.
If you know someone who can put together the components for you then you can dodge that rip-off $100 'test' price -> you can buy a new mb/cpu for that anyway! Building your own is cheaper by far -> only if you shop at the right places. You also can get better warruntees from manufacturers. I have designed a gaming PC with serious performance for $1500 but its accessoried a bit so you could get a powerful PC for you $1200. I recommed the socket 754 athlon 64 route for powerful gaming, and stick to AGP for your price range, AGP cards are still claiming 60+ fps on modern games....
try www.aria.co.uk -> they also btw have a 17" silver TFT for £102 ($190) and a 19" TFT for £189 ($353)
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
pointers are c++ most useful things and is what sets it aside from other languages. Just to name a few uses:
Dynamic arrays
Linked lists
Memory management (eg. passing pointers rather than objects, alloc'ing memory ect..)
Binary Trees and Heaps (great for gaming)
Speed improvement (you can simplify code in some cases with pointers/function ptrs)
the last few being especially important in game programming.
If you still arent sure they are useful then try this: make a list class (or a set of functions) that can grow and shrink in size BUT not lose the contents (so it is NOT dynamic arrays...) without using STL (which, I believe, is a steam based linked list anyway). TIP: You need a pointer to the next and previous list item for it to work!
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
so
#include <iostream>
#include <cstdio>
is equivalent to just including iostream? i beg to differ. Ive included iostream before and still needed to include stdio for some functions, unless it was another error....
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
it might have been confusion of namespaces? surely <stdio.h> should be <cstdio> for namespace std. and vega is right too, that macro needed to be global. only #ifdef / #ifndef / #endif can be in executable statement blocks (i think anyway, there may be others). For example
if(x == 1)
#define message "x equals 1"
else
#define message "x does not equal 1"
will cause all sorts of problems as they are PREPROCESSOR directives -> ie these get processed before compilation and dont affect the running of the program.
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
what error is it showing as the code looks fine to me
1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.0683 seconds
using 2.51MB