Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Badguy13 Badguy13 is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 399
Rep Power: 14
Badguy13 mempunyai hidup yang Normal
Default [help] gan bantu ane dong C programing

ane khan lagi buat tugas.

suru bikin mesin cuci pke C programing.

ane udah selese bikinnya tapi dapet error pas mau save file.

pas dia print kata "ok" langsung eror.



disini gan kayanya erornya


Code:

void Save_File( char stra[] )
{
char ch;
char str[10000];
int count = 0;
int count2 = 0 ;
int count3 = 0 ;


if ((ptr = fopen("Log.txt" , "r")) == NULL)
{
printf("ok");
count = 0;
//ptr = fopen("BobyLog.txt" , "w");
while ( stra[count] != '' )
{
putc( stra[count] , ptr); //putc() character to store character from string into sPtr stream
count++;
}
}
else
{

count3 = 0;
while( (ch = getc(ptr) ) != EOF) //The getc() function returns the next character from stream sPtr
{
str[count3] = ch;
count3++;
}

while ( stra[count2] != '' )
{
str[count3 ++] = stra[count2];
count2++;
}
str[count3 ] = '';

ptr = fopen ( "Log.txt" , "w");
while ( str[count] != '' )
{
putc ( str[count] , ptr );
count++;
}
}

klo agan mau liat full nya disini

mohon pencerahhannya agan2 sekalian

ane minta tolong gan ane udah muter2 tambah eror malah.


Spoiler for jangan dibuka:




ane cuma minta bantuan. mohon jangan , klo agan2 berbaik hati boleh minta









Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 02:19 PM.


no new posts