15,552 Topics
| |
Goodevening, I'm starting coding in C and I've done a little program to understand "struct" function, but... I receive this message: Segmentation fault: 11 I've understood a bit what this problem is about, but I can't understand where it borns on my program. Can you help me? I tank you! … | |
Hello , I want to scan each row and find in each column the max element and the corresponding index. Then , swap this column with the column which belongs to the main diagonal ( if a condition is valid ). Finally , do the same for the rest rows. … | |
int subroutine (char *input, float *buffer) { *buffer = malloc(...) buffer is calculated from input } or flot subroutine (char *input) { *output = malloc(...) buffer is calculated from input return(buffer); } int main(int argc, char *argv[]) { float *data; subroutine(argv[] ...) ... free(data) } 1) which subroutine is recommended? … | |
how to write a c program that allows the user to input grade and get the mark range using the switch statement,and the program only terminates when the user presses the esc key | |
| I am trying to read a file and follow instructions based on its contents, add them to a linked list. I have the all the file handling written but am still having trouble with pointers and linked lists. The instructions from the input file would go like this i n … |
A variable of type double named area holds the area of a circle. Write a statement to output on the screen the area in two decimal places | |
Hey guys, seems like im doing something wrong here 2 occurs 4198861 times* in an array of size 100, i need another set of eyes if anyone can point me in the right direction #include <stdio.h> //proto void printOccurrence(int countArray[], int countSize); //main int main(void) { //variables int arraySize = … | |
I have created a sample program on C.When i try to run on a different system (win 7 64 bit) it is asking for x64 version of the file (of the executable file created ). P.S. - I am not talking about the compiler, but about the executable file created … | |
| |
I need a list of all available preprocessor directives in C. | |
hello friends, may anyone help me with a code in c for the mechanism of using an atm machine, conditions 1.acc balance starts at zero 2.do not use global variables 3.loop the main menu after every transaction until user presses exit 4.after every transaction user returns to the main menu. … | |
| As a part of my assignment I need to solve a problem in which I have to take space seperated inputs. I have already done my homework and stuck at a point where I have to take space seperated integers when number of integers are not predecided i.e whether there … |
I dont know if this a right place to ask but anyway here you go: I am trying count all occurrences word are that are in the file but i dont know how to do it but I can only do in like user have input in not from a … | |
Can anyone give me an idea how to do this? I have a list(C++) of bytearray and I want to fire a post request to the server using CURL library? I have searched a lot and they say to set the CURL_POSTFIELDS but that requires a char * field. I … | |
Can anyone please convert this to Javascript? function execute(array $ops) { $stack = new \SplStack(); foreach ($ops as $op) { if (is_numeric($op)) { $stack->push((float) $op); continue; } switch ($op) { case '+': $stack->push($stack->pop() + $stack->pop()); break; case '-': $n = $stack->pop(); $stack->push($stack->pop() - $n); break; case '*': $stack->push($stack->pop() * $stack->pop()); … | |
Hello! I'm a programmer that mostly just writes code for operating system kernels, and device drivers. I was wondering how much most people would get paid for doing so. | |
Sqlite is a single user database application. It has many capabilities. It would be appreciated if either a link to an example, or some sample code could be shown for creating, inserting and querying a database. | |
Implement a C function that can perform addition of two 15-digit (positive) integers. As in C the maximum integer number that can be stored in memory is 2147483647 it is not possible to use primitive data types in order to add very large whole numbers. For this reason, you are … | |
Hi, I need to read text from file and then as outcome show separate words, but shuffled. I tried few codes but non of these works for me. I'm getting output, but it do not shows words, but some signs only. I'm posting both codes.. #include<stdio.h> #include<string.h> #include <stdlib.h> #include … | |
I am damn confused between these two terms. Can anyone explain this using some example? Thanks in advance. | |
This problem is troubling me from so long time. There are N scientists, K black holes, and any scientist can query about radius, size and temperature of any blackhole. You have to answer three kinds of query basically: 1)Given Scientist queried for which blackholes,Given scientist queried for which attributes 2) … | |
int find(int x) { for(int i=0;i < n; i++) { if(a[i]==x) return i; } return -1; } int find(int x) { for(int i=0;i < n/2; i+=2) { if(a[i]==x) return i; if(i+1 < n && a[i+1]==x) return i+1; } return -1; } int find(int x) { for(int i=0;i < n/3; i+=3) … | |
When I have a simple server-client code, how do I get the client to send the server a time request and the server responds, and the client then displays the offset and the delay ? The communication should be in NTP. I think that means there are 4 time stamps, … | |
| There is any way to create a program in C which will be able to translate words using google translate or bing translator? I've already downloaded curl library (Ubuntu 14.04), but don't know exactly how to start in pure C. I'm beginner programmer. Thanks for help. |
I am familiar with java. but now i want to learn either of these. so which would be better to learn?? | |
Hi everyone! I am making a program in C where the user will input a month then the program prints out all the names of files created in that month. Right now I'm having trouble in printing the names of files. Here's a portion of my code. Can you help … | |
Hi, Let's say I have an array of 10 elements. I want user to enter 9 numbers so that they fill arrays 0 to 8 (9 numbers). Now I shift the arrays +1. so array[0] is now array[1] and so on. Now I ask user to enter 10th number (fills … | |
Okay, so this is my current code: #include <stdlib.h> #include <stdio.h> #include <stdint.h> struct Display { int width; int height; char **array; }; struct Display *display_create(int width, int height) { struct Display *display = (struct Display *) malloc(sizeof(struct Display)); display->width = width; display->height = height; display->array = (char **) malloc(sizeof(char) … | |
Hey! I'm a beginner and I am making a code about getting the directory of a file, but I have something that I don't understand. What's the meaning of "./" in `DS = opendir ("./");` I have searched a lot of sites about C programming, but nothing gave me a … |
The End.