Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Whats wrong in this code? :P

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Krloz
Grandmaster Cheater
Reputation: 0

Joined: 25 May 2006
Posts: 525
Location: Mexic00l

PostPosted: Sun Apr 29, 2007 2:59 pm    Post subject: Whats wrong in this code? :P Reply with quote

It just crashes when I try to print variable Nombre


Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int nombre;
    //int edad;
    //int ano;
       
  printf( "Que pedo wey\n");
  printf( "Este es uno de mis primeros programas asique esta un poco pedorrilo\n");
  printf( "Dime tu nombre =)\n");
  scanf("%d", &nombre);   
  printf( "A que onda ");// , nombre);//    nombre);
  sprintf(nombre, ":D");
 
 
 
 getchar();   
  return 0;
}


I know I suk but whats wrong xD

_________________
Pin Skipper
Banned by x0r on Tue May 69, 3662 24:09 am. Expires: ForeVa
Reason: Copying gamesguru sig
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Apr 29, 2007 3:07 pm    Post subject: Reply with quote

sprintf is wrong, you cannot put a formatted string inside a number

Code:

#include <stdio.h>

void main()
{
   int nombre;
   
   printf("Enter nombre.");
   scanf("%d", &nombre);
   printf("nombre is %d :D", nombre);
}
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Mon Apr 30, 2007 3:16 am    Post subject: Reply with quote

lmfao dude use a string or char?
_________________
Back to top
View user's profile Send private message MSN Messenger
Krloz
Grandmaster Cheater
Reputation: 0

Joined: 25 May 2006
Posts: 525
Location: Mexic00l

PostPosted: Mon Apr 30, 2007 1:19 pm    Post subject: Reply with quote

Oh I didnt mean to it I changed it to see if it worked but I originally used printf, its because the tutos I use are so crappy x.X
_________________
Pin Skipper
Banned by x0r on Tue May 69, 3662 24:09 am. Expires: ForeVa
Reason: Copying gamesguru sig
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites