WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Need to get fclose prog to compile right, c fclose issue, may be syntactic

gruffy
Quote Post


New Member
*

Group: Members
Posts: 12
Member No.: 43493
Joined: 25-April 11


Hi all, hope someone can help here, i cant seem to get this to compile.
maybe im tired and have not looked at it, but its a bit like blind leading blind etc, meaning not sure what the error is referring to, i have enclosed an attachment image of the error thrown on line 13 in the code.

dev is in codeblock using minGW compiler, if this helps
Thanks again for taking time to read this
gruffy

CODE
#include <stdio.h>
#include <stdlib.h>

int main()
{
FILE *file_test;

       file_test = fopen("test.txt", "w" );

       if( file_test != NULL)
       {
           printf("File has been created\n");
           fclose( *file_test);
           return 0;
       }
       else
       {
           printf("Unable to create file\n" );
           return1;

       }

}


:)
Thanks again
:)
SHOUTS to TerVel, amazing dude who has many good things to say in terms of guidance ! :D

Attached Image
Attached Image

Sponsored Links
PMEmail Poster
Top
win_user_9876
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 51298
Joined: 30-April 12


// use this instead:
fclose( file_test);
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google