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 / c

c

|

Miscellaneous › Others › c

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 11 months ago by Hari Prasaath K.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 1, 2015 at 6:15 pm #3656
    suresh
    Participant

    #include<stdio.h>
    main()
    {
     char s[]={'a','b','c','','c',''}
     char *p,*str,*str1;
     p=&s[3];
     str=p;
     str1=3;
     pf("%d",++*p+++*str1.32);
    }

     

     

    friends give me output by GCC compiler and how can i rectify those…………..

    January 4, 2017 at 12:16 pm #14321
    Hari Prasaath K
    Participant

    Hi,

    Line 8: Constant cannot be assigned to the pointer

    In printf you have mentiond .32 it will throw an error

    To get an output the above code can be rewritten as

    #include <stdio.h>
    void main()
    {
     char s[] = {'a','b','c',' ','c',' '};
     char *p, *str, *str1;
     p = &s[3];
     str = p;
     *str1 = 3;
     printf("%dn", ++*p + ++*str1);
    }
     
    Output:
    While Running using gcc compiler ans will 36.
     
    *Note: Output will vary for different compilers.

     

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

RSS Recent Posts

  • Solid State DC Circuit Breaker Breakthrough: First Applied to the New Generation of Railway Electric Locomotives December 17, 2025
  • Ceramic capacitors voltage rating December 17, 2025
  • What is involved to convert a small town to fiber optic? December 17, 2025
  • How do I choose the right stepper motor for my DIY 3D printer? December 17, 2025
  • What is this called and what was it for December 17, 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