LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-24-2011, 01:16 AM   #1
ostrow30
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Rep: Reputation: Disabled
strange value assignments variable = value, value??


I'm going through some C code, and I ran into this:

Code:
char *m,*r,*src = s,*cp;
Can anyone explain what is happening here in general? I can't understand how you can assign 2 values (s and *p) to a variable.
 
Old 07-24-2011, 02:27 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Only the value 's' is being assigned to '*src' -the comma separates the next declaration '*cp'.
 
Old 07-24-2011, 07:59 AM   #3
ostrow30
LQ Newbie
 
Registered: Jul 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
LOL! Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Strange behaviour in bash comparison when variable contains arithmetic operator michael.wegemer Programming 3 10-19-2010 05:22 AM
Very strange $PATH variable problem -- Desperate for HELP! W0bbles Slackware 2 01-31-2006 11:24 PM
strange value of variable after a php form jeanpba Linux - Software 0 11-15-2005 02:38 AM
Key Assignments orlenok Linux - General 1 10-04-2003 01:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration