Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I intend to extract data from excel into my program. What i want is the data from excel should be stored as an array in my program.
I have written the following code but it does not work.

C#
f1=fopen("Cost.xls" , "r");
  for(i=1;i<=m;i++)
	{
	 	for(j=1;j<=n;j++)
			{
		 		fscanf(f1,"%d",&c[i][j]); 
			}
		fprintf(f1, "\n");
	}
  fclose(f1);
Posted
Comments
[no name] 2-Feb-16 0:00am    
http://www.codeproject.com/Questions/417270/Reading-from-and-writing-to-Excel-files-in-Cpluspl
KarstenK 2-Feb-16 3:03am    
Write it as answer ;-)

1 solution

This question has been asked and answered fully in this forum.
Reading from and writing to Excel files in C++[^]

If you can work with csv files this is the easiest approach.
 
Share this answer
 
Comments
CPallini 2-Feb-16 3:21am    
5.
[no name] 3-Feb-16 3:21am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900