- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert a string to a integer in C
First extract characters from left bracket '(' using strchr() function.
char *name="The Matrix(1999)"; char *ps; ps=strchr(name,'(');
Then add each character within brackets () to an char array
char y[5]=""; int p; for (p=1;p<strlen(ps+1);p++) { y[p-1]=ps[p]; } y[4]='\0';
Lastly convert resultant string to integer using atoi() function
year=atoi(y); printf("year=%d",year);
You can now apply required filters ti create array of strings of all movies prior to 2008
Advertisements