Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #19057

Re: What's wrong with this simple code?

From blp@cs.stanford.edu (Ben Pfaff)
Newsgroups comp.lang.c
Subject Re: What's wrong with this simple code?
Date 2012-03-26 09:45 -0700
Message-ID <87haxb71lf.fsf@blp.benpfaff.org> (permalink)
References <48d7ec09-3c0d-4e4a-9c95-3479417fbf34@x5g2000pbl.googlegroups.com>

Show all headers | View raw


fajar96te <fajar.suryawan@gmail.com> writes:

> When I tried to compile this:
>
> // ==============
> #include <stdio.h>
> void main()
> {
>     char k[4] ;
>     k = "abc" ;
> }
> // ==============
>
> I got:
> error: incompatible types when assigning to type 'char[4]' from type
> 'char *'

You can't assign to an array.
-- 
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa67f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}}

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What's wrong with this simple code? fajar96te <fajar.suryawan@gmail.com> - 2012-03-26 09:28 -0700
  Re: What's wrong with this simple code? blp@cs.stanford.edu (Ben Pfaff) - 2012-03-26 09:45 -0700
  Re: What's wrong with this simple code? Jens Gustedt <jens.gustedt@loria.fr> - 2012-03-26 18:45 +0200
  Re: What's wrong with this simple code? "BartC" <bc@freeuk.com> - 2012-03-26 17:45 +0100
  Re: What's wrong with this simple code? jt@toerring.de (Jens Thoms Toerring) - 2012-03-26 16:50 +0000
  Re: What's wrong with this simple code? James Kuyper <jameskuyper@verizon.net> - 2012-03-26 13:52 -0400
    Re: What's wrong with this simple code? nick_keighley_nospam@hotmail.com - 2012-03-29 00:16 -0700
    Re: What's wrong with this simple code? fajar96te <fajar.suryawan@gmail.com> - 2012-03-28 17:23 -0700
      Re: What's wrong with this simple code? Sjouke Burry <s@b> - 2012-04-02 20:39 +0000
      Re: What's wrong with this simple code? "BartC" <bc@freeuk.com> - 2012-04-02 22:07 +0100

csiph-web