EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / bugs in c programming

bugs in c programming

|

Miscellaneous › Others › bugs in c programming

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 10 months ago by Ashutosh Bhatt.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 1, 2014 at 3:35 pm #3200
    Hamdy Fouad
    Participant

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

    int main()

    {   

     

     

        printf(“enter your name :) n “);
        char name [74];
         char person [74];
        scanf(“%[^n]s”,name);// scanf can deal in this case with multi word
        printf(“Hello  %s! n “,name);
        printf(“enter your name :) n “);
        gets(person);
        getchar();
        puts(“hello “);
        puts(person);// a run time problem

    }

    August 2, 2014 at 8:04 pm #11972
    Ashutosh Bhatt
    Participant
     
    many problems in your code
     
    #include <stdio.h>

    #include <stdlib.h>

    int main()

    {   

        printf(“enter your name :) n “);

      ( you have to define it just after main)

    char name [74];

         char person [74];

    (in scanf you have to pass the address of variable like &name)

        scanf(“%[^n]s”,name);// scanf can deal in this case with multi word

    (use gets and puts for string operations)
        printf(“Hello  %s! n “,name);
        printf(“enter your name :) n “);
        gets(person);
        getchar();
        puts(“hello “);
        puts(person);// a run time problem

    }

     

    August 2, 2014 at 9:09 pm #11974
    Hamdy Fouad
    Participant

    thanks alot  for such a rapid reply

     

     

    (use gets and puts for string operations)

     

    can you explain more

     

    August 3, 2014 at 12:21 pm #11975
    Ashutosh Bhatt
    Participant

    you have already used these functions

    like

     

    char name[30];

     

     

    printf(“enter name”);

    gets(name);

     .

     .

     .

     .

    printf(“name of person is “);

    puts(name);

     

    i suggest for such basic programs refer good books on C language programming like “let us C”

     

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Saga 1400sv vinyl cutter motherboard issue June 20, 2025
  • PIC KIT 3 not able to program dsPIC June 20, 2025
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz June 20, 2025
  • using a RTC in SF basic June 20, 2025
  • Relay buzzing after transformer change? June 20, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise