All Content
Blogs
Forums
News
Tutorials
Log In
Sign Up
Login
Username / Email
Password
Remember me
Forgot password?
Login
or
Don't have a GameDev.net account?
Sign up
Forgot your password?
Email Address
Reset Password
Please contact us if you have any trouble resetting your password.
Home
Blogs
Forums
News
Portfolios
Projects
Tutorials
42
users logged in
New?
Learn about game development
.
Before posting, review our
community guidelines
.
Follow Us
Chat in the
GameDev.net Discord!
Mastodon
Back to NeHe Productions
OT: fscanf
NeHe Productions
Affiliates
Started by
penetrator
January 18, 2003 06:27 PM
1
comment, last by
penetrator
21 years, 3 months ago
penetrator
122
Author
January 18, 2003 06:27 PM
fscanf( stream2, "%24c", max_elev); The above instruction reads 24 chars into max_elev. How can i specify a variable number of chars to be read ? Something like int numberofchars=24; fscanf(........ ?????
www.web-discovery.net
Cancel
Save
Advertisement
pplante
122
January 18, 2003 07:31 PM
Try the following:
int size = 24;
char sz[256];
sprintf(sz, "%%dc", size);
fscanf(stream2, sz, max_elev);
That might work, tho I can''t besure.
Cancel
Save
------------------------"If it says it loves me, how can it be a virus?"
Derilect101
122
January 18, 2003 10:38 PM
why not just do like
char line[24];
fgets(line, 24, stream2);
Cancel
Save
This topic is closed to new replies.
Advertisement
Popular Topics
How do you manage yourself and your time as years pass on?
GDNet Lounge
Too many managers?
General and Gameplay Programming
The promise of freedom in story games
Game Design and Theory
Facebook Ads for sales on steam, does it work?
Games Business and Law
New Generated Constructor & JIT Issue
AngelCode
Inheriting from application registered class
AngelCode
Advertisement
Recommended Tutorials
Spectral Synthesis Noise for Creating Terrain
General and Gameplay Programming
Debugging - Follow The Data
General and Gameplay Programming
The Simplest Game Possible
General and Gameplay Programming
Austin GDC 09
Event Coverage
Incorporating Search Algorithms into RTS Game Agents
Artificial Intelligence
Reticulating splines
About GameDev.net
Community Guidelines
Terms of Service
Privacy Policy
Contact Us
Copyright (c) 1999-2024 GameDev.net, LLC
Back to Top