15,552 Topics
| |
If i have a 2D matrix of characters or integer or whatever!How do i check if another matrix is a sub-matrix of The 2D one ...Please!! help with simple code that work for any size of the matrices Thanks in advance to all . | |
hi :) i managed to compile it but when i try it - it scream Segmentation-Fault. i have no idea where it happens exactly . only know that it happen :( can someone help me ? thanks in advance the program try to implement some kind of hash table : … | |
Hi I'm REALLY new at C and am getting this "constant out of range in comparison error". The line with the error is this: [CODE]printf("Would you like you enter additional sets of data? (yes/no)"); scanf("%c", &answer); while( answer == 'yes'); <------ this line [/CODE] I haven't done character strings in … | |
Hi, Please answer the below questions....thanks 1) How can I free the memory from main(). But the memory was allocated in function a(). void a() { char *b=malloc(10); } main() { a(); } 2) How can I return the local pointer variable? main() { char *a=result(); } char * result() … | |
Hello, I am using strncpy to copy the first line of a multi-line buffer. I have successfully found the amount of characters to the end of the first line, and I have performed a strncpy to copy the first line of the buffer to a char *. However, some of … | |
I've got this exercise from a book that wants me to program two rolling dice, add the value of the dice to together and basically track each time a number is rolled. So ive got an array with 11 spots for the numbers 2 - 12. Whats not working in … | |
I am trying to implement an expert system in C. I have written each rule in the expert system as a function. However, I want my system to be more flexible and can process these rules from an external file specified at run time rather than hard-coded. This will provide … | |
Hello again, YOu guys have been such a big help in helping me understand what I'm doing wrong in my programs I'm hoping that I can get help again. I am currently writing a code in C. I'm supposed to be writing a code that has the Fibonacci Series up … | |
hi guys, can't understand why the answer of the following program is 7? Please explain.. [CODE]#include <stdio.h> #define SQ(x) x*x int main() { int a,b; a=5; b=-SQ(a+2); printf("%d",b); return 0; } [/CODE] thank you.. | |
hello frnd this a c program that removes c c++ style comments | |
I need to read in a csv file created by MSExcel into an array. The file contains 750 rows of 5 sets of numbers some int. some float. the format looks like this: 301,36,0.285,2.88,15.000 302,88,0.247,2.88,75.500 How do I read this data in a 'C' program without the commas, and then … | |
I am stuck on this program that I am supposed to create. It has to ask the user for a text file where the format looks like: MATH 101 GEOLOGY 101 GYM 101 Then i'm supposed to store the information from the file in an array which then gets pointed … | |
I have say a loop. At the beginning of the loop I want to fill a very large array which is an array of structures. Is there way like memcpy to fill the array without going through for loop. I figure using memcpy instead of for loop would be a … | |
First how do you use Dynamic and Static Memory Allocation? and why is supposed to be so popular in use? | |
Hello, I have a a problem copying individual words inside 2D array. Array is dynamically created and initializes perfectly, but as soon as i call my function, and if i have 2 or more spaces between the words, its copying the spaces inside the next index element of the array. … | |
I have a code which throws "segmentation fault" after some computation. I was looking for some help with efficient memory management. My program does the following: I have a grid with min. i,j,k coordinates -52, -34, -35 and max. i,j,k coordinates 53, 37, 33. (In i, j, k loop). I … | |
I have a servlet written in Java and I am attempting to send data to the method using C and the WinSock2 API. When I attempt to just send the raw data I get an invalid stream header error. I am not sure how I should go about handling this … | |
Hello,everybody.Would you please describe me about the differences between the(|=) ,(^= ) operators?Is it possible to use(&=)instead of the above two assignments and how? Thanks,[code]Assignment,compound operators;[ |=,^= and &=][/code] | |
I was writing a program and wanted to write a struct that's used to match an input string and print a corresponding output. However, I ran into a very unexpected problem. This code gave me the compile error below. [code] #ifndef MATCH_H #define MATCH_H #define TOTAL_WORD_PAIRS 2 typedef struct { … | |
Does anyone know how to do file input and output with spreadsheets? Specifically I'm going to be using the open office spreadsheet. thanks | |
I use a non english keyboard and i'm writing a console program. When i want to check a non english character with using getch, it returns wrong ASCII values(it gives the same number for different characters). But when i try to use getchar, it returns the true ASCII numbers. But … | |
I am not familiar with linked list, can any one help? | |
Hello Guys, I am trying to read lines from .xml file using a C program. Basically what program does is read the date, and if the current system date is in the range of the date range given, it fetches some data from the next lines in the date. However,my … | |
Hello, Please see the code below. it combines 2 strings into one. [code=c] #include<stdio.h> #include <string.h> int main() { char a[10], b[10], *p = NULL, *combine(char *s, char *t); strcpy(a, "horse"); strcpy(b, "fly"); p = combine(a,b); printf("%s\n",a); printf("%s\n",b); printf("%s",p); } char *combine(char *s, char *t) { int x,y; char r[50]; … | |
Hello. I'm trying to find out how to make it so only certain applications I have given authorisation to can use a C DLL I have created so that when I release it with a .Net application it cannot be used by others. I found out how to check what … | |
I am facing some problems trying to understand the difference in handling strings when they are declared as a char array and when they are declared with a pointer pointing to them. In the following code snippets, I have a few doubts. 1.While code 1 works correctly, code 2 crashes … | |
how to check there exist number in string using isalpha.if number exist, display "only alphabetic,please input again" example : user input = i had to 2 number | |
When I run my code, I get "Run-Time Check Failure #2 - Stack around the variable 'string' was corrupted." I have looked everywhere in my code for a source of this error, and I can't find one, I've also looked where a buffer overrun could occur. The variable string is … | |
Alright, the issue I'm having is figuring out whether or not I'm causing memory leaks. I'm considering three situations which might or might not be the same: 1) If I declare a variable in a block of code as a character array, I'm making a pointer to it. But when … | |
Hello, I am saving my data in a text file. I can successfully access my file and add records in it and even search it. but when it comes to del a record i dont know how to do it. Can some one please advice. Regards, Vishal |
The End.