This is what I expect my string array s to be after the program is run: {"#0", "#1", "2"}. This is what I am getting: {"#2", "#2", "2"}. How do I modi ...
This is what I expect my string array s to be after the program is run: {"#0", "#1", "2"}. This is what I am getting: {"#2", "#2", "2"}. How do I modi ...
I require to build a simple Arduino function that returns either "char*" or "const char*" type and then I need to print that value. However, I'm faci ...
I am writing a C function GetDeviceList() which must return a list of device names found as strings somehow. The number of devices found and of course ...
As far as I know, a string literal can't be modified for example: That would not work since string literal is read-only. I can only modify it if: ...
hope you are well. I recently started learning ADT (Abstract Data Type) in college, and I have an assignment that states the following: Complete ...
Whenever I create a char* with malloc(), the first few bytes get random data, which is different every time I compile the code. In this case, I wanted ...
Currently reading K&R and just got stumbled across the char pointers. There's nothing about memory allocation when defining char pointers in the b ...
So from this code I want to display string argv[1] at the center of the terminal. When the user press u I want to make it uppercase when the user pr ...
I am new to C programming. and I know char * and char[] array are different. Yet, you can deduct the char[] to char * when it comes to a function para ...
In plain C, pointers to void are useful as arguments to generic functions, such as a generic quicksort, or a generic swap, etc., as seen here: Implem ...
I want to take 1 line only from some specific file and put the line into the char pointer (*s). I made this function but when I run the program it d ...
I already looked with a debugger and i get this error when it leaves the main() function. Here's my Code: Thanks for your help. ...
I am failing to understand why when I print out *K, I just get the first character of the input string but if I print out the commented line(just K ...
I'm trying to write my own strchr function for school, but there is something I don't understand. char *ft_strchr(const char *s, int c) { size ...
i'm new in C programming and I am trying to open a txt file for reading it. I have a text file with different file names I want to read, each one in a ...
Casting this Vector3 into a const char* has worked in implicit and explicit conversions, but hasn't when attempting to convert it at construction time ...
i have a custom class, let's call it "Student" and a main method. I'm instanciating the class, and just want to output the content of the class. My p ...
Yesterday, someone showed me this code: That results in: I am very confused, mainly with the line in the for loop. From what I can tell, it seem ...
Hi im trying to access strings stored in 2 different arrays using an array of pointers using the code: replacing x and y with x=1 y=0 prints car, w ...
I'm trying to open a char* that's being exported from a Dll in my C# project. Since the codes are too much, I'll write a short code that is similar t ...