Click here to Skip to main content
15,891,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp with number to string conversion Pin
TabascoSauce23-Feb-09 14:09
TabascoSauce23-Feb-09 14:09 
AnswerRe: Help with number to string conversion Pin
Stuart Dootson23-Feb-09 14:26
professionalStuart Dootson23-Feb-09 14:26 
GeneralRe: Help with number to string conversion Pin
TabascoSauce23-Feb-09 15:32
TabascoSauce23-Feb-09 15:32 
QuestionNon-Static Member Call Question Pin
Rangarajan Varadan23-Feb-09 12:51
Rangarajan Varadan23-Feb-09 12:51 
AnswerRe: Non-Static Member Call Question Pin
Stuart Dootson23-Feb-09 13:53
professionalStuart Dootson23-Feb-09 13:53 
GeneralRe: Non-Static Member Call Question Pin
David Crow23-Feb-09 16:26
David Crow23-Feb-09 16:26 
GeneralRe: Non-Static Member Call Question Pin
Rangarajan Varadan25-Feb-09 10:40
Rangarajan Varadan25-Feb-09 10:40 
Questionread comma delimeted numbers and text mixture in a line [modified] Pin
mrby12323-Feb-09 12:08
mrby12323-Feb-09 12:08 
Hi

I would like to read each number (integer and float) and a word (e.g. E1) in between these numbers:


1,1,1,E1,0.13060,-0.40193,-0.90631
7,1,1,A25,0.13060,-0.40193,-0.90631


Using the statement:

char buffer[15];

for (i=0;i<2;i++)
{
fscanf(f_ptr1,"%i,%i,%i,%s,%f,%f,%f\n",&kdum[i],&nlinks[i],&ndih[i],buffer,&cos_xx[i],&cos_yy[i],&cos_zz[i]);
...
}

"buffer" should read only "E1", but it reads: "E1,0.13060,-0.40193,-0.90631"

I need:
kdum[0]= "1"
nlinks[0]="1"
ndih[0]="1"
buffer="E1"
cos_xx[0]="0.13060"
cos_yy[0]="-0.40193"
cos_zz[0]="-0.90631"

kdum[1]= "7"
nlinks[1]="1"
ndih[1]="1"
buffer="A25"
cos_xx[1]="0.13060"
cos_yy[1]="-0.40193"
cos_zz[1]="-0.90631"


Thanks for help

modified on Monday, February 23, 2009 6:33 PM

AnswerRe: read comma delimeted numbers and text mixture in a line Pin
Stuart Dootson23-Feb-09 12:40
professionalStuart Dootson23-Feb-09 12:40 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 12:47
mrby12323-Feb-09 12:47 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
Stuart Dootson23-Feb-09 13:48
professionalStuart Dootson23-Feb-09 13:48 
AnswerRe: read comma delimeted numbers and text mixture in a line Pin
David Crow23-Feb-09 16:29
David Crow23-Feb-09 16:29 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 16:47
mrby12323-Feb-09 16:47 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
David Crow24-Feb-09 2:40
David Crow24-Feb-09 2:40 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 19:05
mrby12323-Feb-09 19:05 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
David Crow24-Feb-09 2:23
David Crow24-Feb-09 2:23 
QuestionHow to fix the Linking error Pin
SIJUTHOMASP23-Feb-09 10:33
professionalSIJUTHOMASP23-Feb-09 10:33 
AnswerRe: How to fix the Linking error Pin
Stuart Dootson23-Feb-09 12:37
professionalStuart Dootson23-Feb-09 12:37 
GeneralRe: How to fix the Linking error Pin
SIJUTHOMASP23-Feb-09 23:58
professionalSIJUTHOMASP23-Feb-09 23:58 
QuestionRe: How to fix the Linking error Pin
SIJUTHOMASP24-Feb-09 8:49
professionalSIJUTHOMASP24-Feb-09 8:49 
QuestionHow to develop a DLL Pin
alizey khan23-Feb-09 7:08
alizey khan23-Feb-09 7:08 
AnswerRe: How to develop a DLL Pin
CPallini23-Feb-09 7:30
mveCPallini23-Feb-09 7:30 
AnswerRe: How to develop a DLL Pin
«_Superman_»23-Feb-09 17:30
professional«_Superman_»23-Feb-09 17:30 
QuestionNeed to compile the vc++ project in vs2008 Pin
P A N K A J23-Feb-09 5:02
P A N K A J23-Feb-09 5:02 
AnswerRe: Need to compile the vc++ project in vs2008 Pin
Maximilien23-Feb-09 6:59
Maximilien23-Feb-09 6:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.