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 / Replies / C program correction

C program correction

|

Miscellaneous › Others › c › C program correction

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.

 

RSS Recent Posts

  • getting no where fast 8 x 8 led matrix January 23, 2026
  • Expensive hobby January 23, 2026
  • analog logic of shmidt trigger bjt circuit January 22, 2026
  • Micro mouse January 22, 2026
  • Best practices for accurate LiPo battery monitoring on ESP32? January 22, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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