The notes
C, E and G played together are always a C major chord.
A C major chord is always the notes C, E and G. Fret that shape on a guitar, and it's always C Major.
When you play in a different key, C major's role changes.
If you're playing in the key of C major, then C major is the root chord - the I .
F is the fourth chord ( IV ) and G is the fifth chord ( V ).
Lots of simple songs are based on I,IV and V, so you may recognise that set of chords.
If you play in the key of G major, then I is G major, IV is C major, V is D major.
So, in the key of G when you see "C" on the song sheet, you fret the same shape, and play the same notes as you did when you saw "C" in a song in the key of C.
But this time the C is playing a different role.
It is the IV.
It "feels" different; the listener is waiting for you to return to root chord, G. Look through your songbooks and see if you can spot I,IV and V in other keys.
Beginner guitar books tend to use the keys C, G, E, D, A. Edit to add: Here's an analogy.
Think of your C major chord as a circle.
It doesn't matter where you draw a circle; you always draw it the same way.
Seen on its own, it just looks like a circle.
A C major chord just sounds like a C major chord.
The rest of the piece you're playing defines what that C major chord "does".
The key of the piece is a fundamental part of that.
Because of the other lines drawn around the circle, it becomes the sun, or a football, or a planet, or a head, or a compact disk, or whatever the artist chooses.
In the same way, the other notes you play around your C chord, make it take on different purposes in the music.
music.stackexchange.com/users/1252/slim
A C Major chord always contains the same notes (C, E, G), as a major chord is a triad including a root (C), a major third over the root (E), and a perfect fifth over the root(G).
These notes can be rearranged in any order or voicing, but they will still be C, E, and G. If you were playing in a different key, such as D major, there is no diatonic C chord.
There is, however, a C#-dim.
Regardless of which key you are playing, in general if someone says to play a C chord, they will mean C major.
music.stackexchange.com/users/1895/tpburch
Nothing changes.
C-major is always C-major (do-mi-sol) without regard to key.
The only thing that could change is position where chord would be more comfortable to play in certain key.
music.stackexchange.com/users/1962/Miroshko
In well-tempered tuning, a c is a c and an e is an e and a g is a g , regardless of what key you're playing in.
So, guitar (normally) being restricted to well-tempered tuning, there is no way a C major chord could be intrinsically any different in different keys.
Of course there are different voicings in which you can play the chord, the most common being (in tabulature)
e│────0───3───3───8───8───12── b
│────1───1───5───5───8───13── g
│────0───0───5───5───9───12── d
│────2───2───5───5───10──10──
A
│────3───3───3───7───10──x───
E│───
─x──
─x──
─x───8───8──
─x─── but the choice among these mostly has to do with sound and playing comfort, not with a song's key.
This doesn't hold for all tunings, but as far as guitar and common western music is concerned you shouldn't ever need to worry about that.
music.stackexchange.com/users/932/leftaroundabout
The Major chord is based on the 1-3-5 of the major scale.
D Major scale has D as 1, F# as 3, and A as 5, so D Major chord will always be (D,F#,A) played in combination anywhere on the fret board regardless of key!
I just figured this out myself, so yay!!!
Same applies to any Major chord.
C Major is (C,E,G) always etc...
To make a chord minor, just flat the third, so Dm is (D,F,A) and Cm is (C,Eb,G).
The key only shows which chords fit and where they fit, but doesn't change the chord itself.
music.stackexchange.com/users/56023/Mr. GuitarGuy
The only thing I'd add to these answers would be that while no, the key of a song doesn't change the chords, the key you're playing in might force one to play with a capo or a nonstandard tuning.
In those cases, the notes to make a C major are the same, but the shapes of the chords may be forced to change.
music.stackexchange.com/users/37992/user45266
Typically, the "C" is played like this in the key of C:   But when I play another song, in the key of D, is the C chord still played like this? If not, how do I play it on the guitar? Likewise, if the song is in the key of G, how does it change, and is there a pattern to follow? Thanks.
Does the C chord change based on what key it's in?
music.stackexchange.com
<guitar><chords><chord-theory><key>
music.stackexchange.com/questions/5456
music.stackexchange.com/users/1664/Ted Wong
The C chord does not change according to the key. The only thing that could change is position where chord would be more comfortable to play in certain key. Chords will stay the same regardless of which key they are played in.
Chords will stay the same regardless of which key they are played in.