You do not declare it officially and yes you have the flexibility to change it but every application asks you what major you want to study.
Besides by nature if you are already decided and experienced on the subject it is ridiculous to me to consider another applicant. Let's consider two candidates:
1) Super social kid with strong grades in all subjects and a good debater and organized few charity projects (at least on the paper) but no real programming or above average math experience.
2) Kid with good social skills with top grades in mathematics, physics, chemistry, cs etc. but slightly lower secondary language or history grades. This kid also has a Github account with quite a few commits and is hacking for few years now.
Now my recent observation is that (and not only for CS but for all other subjects too) if these two candidates declare that they want to study CS, then the first one is preferred in US and definitely the second one in Britain.
Now I understand not declaring your major at the beginning and being undecided but how can one eliminates the ones who already demonstrate work and passion on their subject but accepts the ones who are undecided and have not done on any specific subject.
As a result, American universities basically depend on "luck". They think the kid might be good based on generic projects, charity work and conferences.
By the way this is not a personal issue. I am accepted to the school I wanted to be in at the beginning but this is an observation through my high school years for over 200-300 well suited candidates for top ranking universities.