Jump to content

help passing values

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Lucian

Lucian

    Newbie

  • Members
  • Pip
  • 2 posts
In a function I I called 'userinput' I am gathering the input from a user and then putting it into one solo string using strcat.

I then want to save this sting into a .csv file. I have the code in that does that (it works when I have it in the same function) but I want a seperate function that saves (I have a menu so the user can answer the questions but it'll only write to the .csv file once you enter the 'save' option)

I had my function like
savedata( char *fullstring)//string I use in other function storing the info 

but when I type in the data then go the the save option on my menu I get a segment fault when doing it.
Am I suppose to do something to the function I am using to get the userinput to allow my other function to access the fullstring value?

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Mind posting the entire thing?

#3
Lucian

Lucian

    Newbie

  • Members
  • Pip
  • 2 posts
nvm fixed it

Edited by Lucian, 14 December 2009 - 05:18 AM.