Linked Questions

0 votes
4 answers
685 views

I'm writing a function that is supposed to split a string on "-" and return and array containing the parts from the string, so if the string is: 2017-10-23 I want the array to have three elements ...
robnix's user avatar
  • 15
-1 votes
1 answer
881 views

[image of an executed code in keil] I've written above code to move an array( msg[ ] ) to Port 0(I'm using Keil µvision), in which 'unsigned int y' gets the size of the array and displays it to Port 1(...
Arshdeep Singh's user avatar
0 votes
3 answers
1k views

I want to pass an array as a parameter. I want the other function to calculate the array size. So array size is not passed as a parameter. How do I do this? #include <stdio.h> #include <...
Dean Smith's user avatar
0 votes
2 answers
448 views

I am just playing around with a simple c code. I want to print all the days string in the days array pointer. However I am running to segmentation fault. The problem lies in the for loop. What am I ...
Sunil Gautam's user avatar
1 vote
1 answer
756 views

I have a problem here. I'm unable to get how many pointers are there in one row of 2D array of strings. Error says: division ‘sizeof (char **) / sizeof (char *)’ does not compute the number of array ...
Momoos's user avatar
  • 27
-2 votes
3 answers
773 views

I'm writing a program in C to add random numbers to an array. The size of the array is given (say n = 250) and using rand(), I'm generating these numbers (range is 1 to 100). int main() { int n = ...
userx's user avatar
  • 11
-1 votes
1 answer
224 views

I have some C code to practice the quick sort. I want to use macro the get the length of the array. The macro works fine in the main() function. But when I use the macro inside the sort function, it ...
user1323328's user avatar
0 votes
1 answer
370 views

#include <stdio.h> #include <string.h> #include <stdbool.h> int main(int argc, const char * argv[]) { bool isTrue=true; int nums[50]; for (int i = 0; i<sizeof(nums); i+...
Christopher Lee's user avatar
0 votes
1 answer
191 views

I'm kinda new to OpenGL, I am currently trying to make a class which can handle drawing vertices into the screen and it doesn't seem to work, it doesn't draw anything. I know that this problem has ...
Wallop's user avatar
  • 1
0 votes
2 answers
222 views

So what's this line means? int n = sizeof(arr) / sizeof(arr[0]) Why are we dividing arr with arr[0] and whats the use of n here? #include <iostream> using namespace std; int search(int arr[], ...
Doflamingo's user avatar
-2 votes
2 answers
438 views

What is problem with my code, that it shows "stack smashing detected" Problem Statement: Given an array, we have to find the smallest element in the array. #include<stdio.h> int main(){...
Nitin Pandey's user avatar
0 votes
3 answers
173 views

I'm trying to get the number of floats in the following array: float coins[] = {0.25, 0.10, 0.05}; printf("%i", sizeof(coins)); I get 12. I am trying to get 3. What am I missing here?
John's user avatar
  • 3,916
0 votes
2 answers
89 views

I need to pass an array inside a routine and then to read its size. typedef struct { unsigned char Name[20]; }Sensors_; extern volatile Sensors_ Sensor; then inside source file I'm using this ...
ddd's user avatar
  • 105
1 vote
5 answers
100 views

Someone gave this code as a method to find the length of an array called a: std::cout << "Length of array = " << (sizeof(a)/sizeof(*a)) << std::endl; The only thing I don't ...
frankfurt's user avatar
0 votes
1 answer
89 views

This function is supposed to read and expand my array (stringa) until the user hits enter, then expands also reverse to the same size of stringa. But after 3 letters the program just stops void ...
Stefano Carletto's user avatar

15 30 50 per page
1
2
3 4 5
12