I'm writing a parser, and im totally confused. Its apparently correct, but something is happening:
I do a fread command to a char array of the entire file (it isn't big), this is the file: -
sphere
-
{
-
center <-3,0,0>
-
radius 2
-
}
-
light
-
{
-
direction <1, 1, 1>
-
color rgb(1,1,1)
-
}
-
camera
-
{
-
parallel
-
position <1,0,0>
-
to <0,0,0>
-
up <0,1,0>
-
}
-
settings
-
{
-
image_width 800
-
image_height 600
-
min_weight 1
-
max_recursion_level 1
-
}
-
but the buffer on the debug mode shows this: -
sphere
-
{
-
center <-3,0,0>
-
radius 2
-
}
-
light
-
{
-
direction <1, 1, 1>
-
color rgb(1,1,1)
-
}
-
camera
-
{
-
parallel
-
position <1,0,0>
-
to <0,0,0>
-
up <0,1,0>
-
}
-
settings
-
{
-
image_width 800
-
image_height 600
-
min_weight 1
-
max_recursion_level 1
-
}
-
max_recursion_level 1
-
}
-
it is repeating the two last lines, and the parser fails because it's waiting for an EOF or other simbol..
probably it isn't on the fread sentence, but here it is: -
fread(bufferdata, 1, 100000, fileIn);
-
buffer = bufferdata;
-
bufferdata size is 10.000
What could be happening?
Thanks.
1 2227
Nevermind, after almost 9 searches on google i found the answer..
fread won't append /0 to the end of the buffer it read, so i put it manually there, using the fread return value and it's working fine.
edit:
if any mod want to delete this one, you can do it. Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Wayno |
last post by:
My php logs are coming up empty. I have done all I can think of, and
all that made sense to me. Can someone take a look at my php.ini
please and tell me what you think may be the problem.
I double-checked the path to my error log. It is in
/var/www/logs/php_error_log
Thanks. :)
-Wayne Stevenson
|
by: Don Stevic |
last post by:
I am running VS2005 and using VSTO for Word.
I keep getting this error saying that there is no source code available for
this location when I try and run this application.
I am going to try and reinstall Office 2003 and see if that fixes this, but
it is talking about the mscorlib.dll and that isn’t Office.
|
by: Peter Frost |
last post by:
Please help
I don't know if this is possible but what I would really like to do is
to use On Error Goto to capture the code that is being executed when
an error occurs.
Any help would be much appreciated.
Thanks in advance
|
by: Keith Kowalski |
last post by:
I anm opening up a text file reading the lines of the file that refer to a
tif image in that file, If the tif image does not exist I need it to send an
email stating that the file doesn't exist then skip this file and move onto
the next file (line).
If file is there then move to a sirectory.
Here is the code I have (Feel free to make corrections as needed. If
possible make changes in red)
|
by: SQLJunkie |
last post by:
Hi,
I have installed SQL 2005 RTM on a new server and I keep getting this
error (described below) quite frequently. Was wondering if anyone has a
clue on what's happening here. I tried googling but no success!
This generally happens when I am browsing the tree in Object explorer
in SQL 2005 Management Studio. I can be doing anything - like viewing
databases, or viewing table list or viewing stored procedure list, etc.
| |
by: David Lozzi |
last post by:
Howdy,
I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders!
Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
|
by: soup_nazi |
last post by:
I want to remove duplicate entries within a text file. So if I had
this within a text file...
Applications/Diabetic Registry/
Applications/Diabetic Registry/
Applications/Diabetic Registry/
Applications/Great Plains/
Applications/Great Plains/
Applications/Great Plains/
Applications/Great Plains/Servers/
|
by: jason_cuteboy |
last post by:
Hi all,
Completely new to Vb.net and trying to create a simple VB Office Excel
application/spreadsheet. When I built the project, and excel opens up
an error comes up.... Customization assembly could not be found or
loaded?
File or assembly name
Microsoft.VisualStudio.Tools.Applications.Runtime, or one of its
dependencies, was not found.
|
by: Steve Ametjan |
last post by:
I've been trying to get MySQL-python to install on Leopard for the
past couple of days, and I keep running into relatively the same
error. I'm hoping that someone on this list will be able to help me
out in solving the issue. I'd like to get this solved so I can
continue developing with Django using MySQL since that's what my web
server uses as well. I'd hate to have to develop using a different
database engine on my local...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |