Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Make your MMO dream a reality! -
RPG Maker XP Online System
Home
Script Database
Help
Search
Calendar
Login
Register
Chaos Project
»
Game Development
»
Sea of Code
»
Topic:
Undeclared(first use in function) C++
« previous
next »
Print
Pages: [
1
]
Author
Topic: Undeclared(first use in function) C++ (Read 2645 times)
Zexion
Addicted to LoL
Chaos User
Posts: 1519
LV: 69
Gender:
My anaconda don't...jk it does
Undeclared(first use in function) C++
«
on:
April 02, 2013, 11:49:43 PM »
Okay, so today in class we were doing some in-class activity along with the teacher. She told us exactly what to type and blah blah. I did what she said and I got this error that a variable was undeclared. The variable is defined in the header file that we made. Do I have to declare it again in the main()? I don't know if she did, so I might be doin it rong guys
Logged
Ryex
Arctic Bird of Programming
Global Moderator
Chaos Ultimate
Posts: 5135
LV: 198
Gender:
Wants to write a compiler for fun
Re: Undeclared(first use in function) C++
«
Reply #1 on:
April 03, 2013, 04:43:05 AM »
are you sure the Header file was included in the cpp file?
Code: (cpp)
[Select]
#include 'myheader.h'
was at the top of the file
Logged
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.
DropBox
, the best free file syncing service there is.
(click to show/hide)
Zexion
Addicted to LoL
Chaos User
Posts: 1519
LV: 69
Gender:
My anaconda don't...jk it does
Re: Undeclared(first use in function) C++
«
Reply #2 on:
April 03, 2013, 09:06:49 PM »
Yeah, since it was due yesterday, I just made a cheap fix by re-declaring them in the main file, but I did have the header file defined at the top. I'd like to fix this though because I'm sure it will keep happenning in the future D:
Logged
Print
Pages: [
1
]
« previous
next »
Chaos Project
»
Game Development
»
Sea of Code
»
Topic:
Undeclared(first use in function) C++
Shoutbox
Update
|
Open Popup
|
© SMFPacks