Related
Bruno Ely In C, why can I pass a character array to a function that takes a char *as a parameter, but not the address of the array to a function that takes a char **? UPDATE: Interestingly, changing the parameter type char* qux[12]to does n't completely change
Bruno Ely In C, why can I pass a character array to a function that takes a char *as a parameter, but not the address of the array to a function that takes a char **? UPDATE: Interestingly, changing the parameter type char* qux[12]to does n't completely change
but Some background; I have to connect an EEprom that has an I2C interface. I want to save an array of floats in memory and then read it back. I want to make it asap. Currently, I have the following solution for this, which works great. float a[5];
unsigned ch
bob jane Below is my function that takes a char array of size 2, passes it to the function, and the function should return the same 2 chars (it's a bit complicated when it comes to communicating with hardware devices). The problem is when I pass char(*in)[2] t
open I'm trying to understand more about char pointers in C, but one thing got me. Suppose I want to pass a char pointer to a function and change the value represented by that pointer. Here is an example: int Foo (char *(&Msg1), char* Msg2, char* Msg3){
ch
open I'm trying to understand more about char pointers in C, but one thing got me. Suppose I want to pass a char pointer to a function and change the value represented by that pointer. Here is an example: int Foo (char *(&Msg1), char* Msg2, char* Msg3){
ch
bwebi My XCode (default compiler should be clang?) shows me a warning on this code: Incompatible pointer types passing 'char *(*)[2]' to parameter of type 'char ***'(when calling func) void func (char ***arrayref, register size_t size) {
/// ...
}
int mai
bwebi My XCode (default compiler should be clang?) shows me a warning on this code: Incompatible pointer types passing 'char *(*)[2]' to parameter of type 'char ***'(when calling func) void func (char ***arrayref, register size_t size) {
/// ...
}
int mai
bwebi My XCode (default compiler should be clang?) shows me a warning on this code: Incompatible pointer types passing 'char *(*)[2]' to parameter of type 'char ***'(when calling func) void func (char ***arrayref, register size_t size) {
/// ...
}
int mai
Macaque In the function declaration below, the first parameter is a String, specifically an array of chars, and the third parameter is a pointer to an integer. Is the second parameter a pointer to an array of characters? In other words, a pointer to a pointer?
Macaque In the function declaration below, the first parameter is a String, specifically an array of chars, and the third parameter is a pointer to an integer. Is the second parameter a pointer to an array of characters? In other words, a pointer to a pointer?
Macaque In the function declaration below, the first parameter is a String, specifically an array of chars, and the third parameter is a pointer to an integer. Is the second parameter a pointer to an array of characters? In other words, a pointer to a pointer?
Macaque In the function declaration below, the first parameter is a String, specifically an array of chars, and the third parameter is a pointer to an integer. Is the second parameter a pointer to an array of characters? In other words, a pointer to a pointer?
Zulukas I am trying to call this method #define SIZE 16
void DoSomething(char(&value)[SIZE])
{
}
By this method: void BeforeDoingSomething(char* value, int len)
{
if (len == SIZE)
{
DoSomething(value);
}
}
Trying to do this gives me this
Zulukas I am trying to call this method #define SIZE 16
void DoSomething(char(&value)[SIZE])
{
}
By this method: void BeforeDoingSomething(char* value, int len)
{
if (len == SIZE)
{
DoSomething(value);
}
}
Trying to do this gives me this
Zulukas I am trying to call this method #define SIZE 16
void DoSomething(char(&value)[SIZE])
{
}
By this method: void BeforeDoingSomething(char* value, int len)
{
if (len == SIZE)
{
DoSomething(value);
}
}
Trying to do this gives me this
tiktak I am trying to get the mac address with the following code: void getMacAdress(unsigned char **address)
{
int s;
struct ifreq buffer;
s = socket(PF_INET, SOCK_DGRAM, 0);
memset(&buffer, 0x00, sizeof(buffer));
strcpy(buffer.ifr_name,
unlimited This item table prints different permutations of strings. If I declare the string as a char array in main and pass the array name in the printAnagram function it works fine. But if I declare string as char *s="hello" and pass 's' it crashes. Why? #in
tiktak I am trying to get the mac address with the following code: void getMacAdress(unsigned char **address)
{
int s;
struct ifreq buffer;
s = socket(PF_INET, SOCK_DGRAM, 0);
memset(&buffer, 0x00, sizeof(buffer));
strcpy(buffer.ifr_name,
unlimited This item table prints different permutations of strings. If I declare the string as a char array in main and pass the array name in the printAnagram function it works fine. But if I declare string as char *s="hello" and pass 's' it crashes. Why? #in
tiktak I am trying to get the mac address with the following code: void getMacAdress(unsigned char **address)
{
int s;
struct ifreq buffer;
s = socket(PF_INET, SOCK_DGRAM, 0);
memset(&buffer, 0x00, sizeof(buffer));
strcpy(buffer.ifr_name,
under the moonlight I have to call a method with the following signature: int sendTo(const void* buffer, int length, const SocketAddress& address, int flags=0); My first question is: What exactly const void* bufferdoes that mean? My intention: it means it's a
under the moonlight I have to call a method with the following signature: int sendTo(const void* buffer, int length, const SocketAddress& address, int flags=0); My first question is: What exactly const void* bufferdoes that mean? My intention: it means it's a
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;
Sarah Hyland I have a main function with code: int main()
{
const int SIZE = 80;
char ca[SIZE];
char * pc = ca;
int fPrints = 0;
int bPrints = 0;
int lengthChecks = 0;
ReadString(pc, SIZE);
char test = 'X';
int index = 0;