Thread: Help with scanf character string - total beginner

  1. #1
    Registered User
    Join Date
    Jul 2019
    Posts
    1

    Help with scanf character string - total beginner

    Hey, guys, I don`t know where is my mistake.
    I don`t know where did I write something wrong.

    Please help me. I am really new into C programming language.
    Thank you!
    Thanks a lot!Help with scanf character string - total beginner-programiranje-jpg

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,436
    Maybe
    Code:
    scanf("%s",name);
    This is the correct form for where name is an array of char.

    Or perhaps what you tried, but got the wrong special character (it's & not %)
    Code:
    scanf("%s",&name);
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 08-08-2018, 02:32 AM
  2. Total Beginner
    By daithi81 in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2010, 01:39 PM
  3. Total beginner questions
    By Sparky in forum C Programming
    Replies: 5
    Last Post: 06-22-2008, 04:50 AM
  4. Total beginner, need extreme help
    By OUTOFANSER in forum C++ Programming
    Replies: 3
    Last Post: 06-03-2006, 11:56 PM
  5. total beginner!!!
    By jacquifish in forum C Programming
    Replies: 7
    Last Post: 03-31-2003, 04:54 AM

Tags for this Thread