Skip to main content
Tweeted twitter.com/#!/StackArduino/status/532845045414506497
edited body; edited tags
Source Link

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are:

  1. howHow do iI put the string input parameter in sendSMS?
  2. Do iI also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or iI don't need to use function prototype before the main loop()?

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are:

  1. how do i put the string input parameter in sendSMS?
  2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are:

  1. How do I put the string input parameter in sendSMS?
  2. Do I also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or I don't need to use function prototype before the main loop()?
added 5 characters in body
Source Link
sachleen
  • 7.6k
  • 5
  • 40
  • 57

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are 1. how do i put the string input parameter in sendSMS? 2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?:

  1. how do i put the string input parameter in sendSMS?
  2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are 1. how do i put the string input parameter in sendSMS? 2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are:

  1. how do i put the string input parameter in sendSMS?
  2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?
Source Link
user1584421
  • 1.4k
  • 3
  • 26
  • 36

Functions with string parameters

Inside my main loop there is this string:

String string1;

I have a function that will take string1 as parameter, and use it to send this string as SMS.

sendSMS(string1);

This is the sendSMS() function (without parameters):

void sendSMS()
{ sms.beginSMS(remoteNumber);
  sms.print(finalstr);
  sms.endSMS();
  lcd.setCursor(0, 0);
  lcd.print("Message sent!");
  delay(10000); 
}

My questions are 1. how do i put the string input parameter in sendSMS? 2. Do i also need to use a function prototype for sendSMS()? (so that it appears three times, 1 in the prototype, 1 in the declaration and one in the call). Or i don't need to use function prototype before the main loop()?