lol that's exactly what i did before but people told me to take it out... weird...
Type: Posts; User: c++_n00b
lol that's exactly what i did before but people told me to take it out... weird...
neither of those work... :( ... *sigh*....
Why what's wrong with it? I just have a bunch of funcitons and put them all in a loop function, and then used the loop function in my main.cpp file. If I shouldn't do that, then what should i change?
that did... absolutely nothing...
Plus a struct is much more appropriate for this case since my members are meant to be public...
thx anyways i guess tho :)
Here are the errors I get:
--------------------Configuration: Hangman - Win32 Debug--------------------
Compiling...
Main.cpp
Linking...
Main.obj : error LNK2005: "struct hangman hang"...
nope... :(
yes that works... but how come everyone else can get the code to work without using namespaces. :confused: :confused: :confused:
[edit]
And plus I never used to have to do that... weird... but...
Looks like header files just don't work anymore. Especially the good old <string.h>.
I made a test just to see if something was wrong... and there was.
Here's the codes that I've tried
...
does anybody know how i can fix this problem?
.........
So should i re-instal visual c++?...
:(
:mad: :mad: :mad: :mad: :mad:
:( :( :(
:*(
it doesn't work
it gives me pretty much the same errors as b4.
it has no idea what a string is for some reason.
how can i fix this problem?
nope... same thing.
The strings used to work, so how come they don't work anymore?
btw i don't know if i mentioned it but i have visual c++ 6.0
s***....
From this code
#include<iostream>
#include<string.h>
int main()
{
These are the errors i get when i take out the 'extern' and all that stuff:
--------------------Configuration: Hangman - Win32 Debug--------------------
Compiling...
Hangman.cpp
Main.cpp...
Thx everyone. I don't know if any of that will fix the problem yet, but I'm gonna try it out.
As for the 'extern', I was having linking errors b4 and someone told me to use that. If I should take...
Thx everyone. I don't know if any of that will fix the problem yet, but I'm gonna try it out.
As for the 'extern', I was having linking errors b4 and someone told me to use that. If I should take...
no, the code I posted does compile fine. It's jsut that when I add <string.h> and change char word[10] to string word it gives me all of those errors.
here's the complete code so you guys don't have to wonder what i have in it anymore
main.cpp
#include <iostream>
#include <windows.h>
#include <string.h>
#include "Hangman.h"
well, before I was having problems linking the two files (hangman.h and hangman.cpp) so someone told me to use 'extern' and then define 'struct hangman hang;' in the hangman.cpp file. And yes,...
random is random... I've never had a problem with random numbers b4 where i get the same number each time. I use the random seed generator:
srand(GetTickCount())
with <windows.h> and that...
um... that won't work in a header file. Thx anywayz though :)
... *sigh*...
yeah, actually i can tell you. It gives me about 26 or so errors :(. Is that a pretty good reason? It still isn't working right for me though and btw I'm using Visual C++ 6.0.
For example, when I...
It won't let me use 'string' in the clss
How do you use the if statement with char arrays or a string object? Here is the code I have now but it doesnt' seem to work and I think I've heard somewhere that you can't use 'if' with anything...