answersLogoWhite

0

How string can be passed to a function in c?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

between parentheses: funname ("string")

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How string can be passed to a function in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How are the strings passed to a function?

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)


Write a function that will scan a character string passed as an argument and convert all lowercase letters onto uppercase letters?

/* Write a function that will scan a character string passed as an argument & convert all lowercase characters into their uppercase characters*/ #include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> int str_upp(char c[]) { int i; char x; printf("\n \n"); for(i=0;i<strlen(c);i++) { x=toupper(c[i]); printf("%c",x); } return (0); } void main() { char c[10]; clrscr(); printf("Enter string : \n"); scanf("%s",c); str_upp(c) ; getch(); } /* Output: Enter string : Heloo HELOO */


Function finds the occurrence of a given string in another string?

in C: strstr, declared in string.h


C plus plus library functions for string operations?

You can use "string" class in C++ for string operations or you may use c style string functions as well. #include <string> String class in C++ provides all basic function to operate on strings. you may details descriptin at http://www.cplusplus.com/reference/string/string/


Which function converts string into float?

in C: atof, strtod, sscanf


What is return type of string in c?

In C programming, a string doesn't have a specific return type as it's essentially an array of characters. So, if a function is returning a string, it should be declared to return a pointer to a char (char*), since a string in C is represented as an array of characters terminated by a null character ('\0').


How you can convert from string to int in C language?

Use the atoi() or atol() function.


Call by function in c language?

I guess you meant the following:'In C language, when you call a function,the parameters are passed by-value.'


Why printf is used instead of print in c?

The printf() function prints a formatted string.


What character separates each argument passed to a method?

A comma. For example, if your method name is Method1, and you wanted to pass String a, String b, and int c to it, you would do this: Method1(a, b, c);


C plus plus program to count digit in a string?

Use the following function to count the number of digits in a string. size_t count_digits (const std::string& str) { size_t count = 0; for (std::string::const_iterator it=str.begin(); it!=str.end(); ++it) { const char& c = *it; if (c>='0' && c<='9'); ++count; } return count; }


Geta is a math function or string function?

GetA is a math function and not a string function.