15,550 Topics

Member Avatar for
Member Avatar for johndoe444

I noticed something interesting today. When I run the executable directly it gives no hint where the segmentation fault happened. But if I run it from gdb it gives the line number where the seg fault happened. So I was wondering whether there is any similar utility which I can …

Member Avatar for Salem
0
92
Member Avatar for kxh29

Hello All: I want to create an array of structures like so: [CODE] #define MAX 10 struct hash_tbl { int key; int data; }; struct hash_tbl hash_array[MAX], *ptr; [/CODE] Now, I am having some issues in attempting to "loop" through my array of structures and just generate the some data …

Member Avatar for kxh29
0
245
Member Avatar for vbcielle

how will i round off the return value to decimal place with tis function? [code] unsigned int CalculatePercentage(int TotalComponent, int PartialComponent){ return int((PartialComponent/TotalComponent)100); }[/code]

Member Avatar for WaltP
0
207
Member Avatar for sam_dev

Hey Peeps....... I want help regarding aol instant messenger mail client. i have got its password storage location. it stores it in registry as like this: Hkey_current_user/software/america online/aol instant messenger/users/login I want to know that how this mail client decode its password from this file. Do you have any knowledge …

Member Avatar for WaltP
-2
90
Member Avatar for Freespider

i am writing a code that inputs a struct (of two ints) into an array pointer of this specific struct, i need that some of the "cell" in the array will be empty(with NULL or spam like -568558), but still i need to identify those cells and not print them....just …

Member Avatar for Narue
0
99
Member Avatar for DrewS

Hello I need pthread.h library in my program in C and i am using Visual Studio. how can i use threading in C? i visited this [URL="http://sources.redhat.com/pthreads-win32/"]site.[/URL] but i dont know what to download and where to put it. I mean what am i supposed to download- header file or …

Member Avatar for jephthah
0
128
Member Avatar for donelliewhyte

The compiler is displaying that i have a syntax error at the end of input for the below code [CODE]void doctorreport(void) { system("color 2"); char Target[50]; int tell=0; int Found=0,count=0; char doctor1[30],doctor2[30],doctor3[30]; int health=0,fees=0,collected=0; int choice=0; if((customer1=fopen("transaction.txt","r"))==NULL) printf("THE FILE IS EMPTY"); else { printf("\n\n\t\t PLEASE ENTER A OPTION BELOW FOR …

Member Avatar for Ancient Dragon
-2
87
Member Avatar for donelliewhyte

I am scanning the contents of file and then performing some simple operations. First i want to scan the file for a particular doctor name that works. I have two records in the file but its not incrementing the counter to check patients which belong to that doctor and add …

Member Avatar for Ancient Dragon
0
128
Member Avatar for mrblippy

Hi eveyone :) I am having trouble understanding some big o notation that i have been given in homework. I have tried reading my text books but nothing makes sense to me well. Below is one of the problems i have been given [CODE=C] #include <stdio.h> int main() { int …

Member Avatar for Narue
0
131
Member Avatar for gerard4143

Hi, I have a simple question about the Linux Shebang '#!'. Well more of a clarification of how Linux handles #!. My understanding.... When the operating system 'Linux' encounters an executable file with the first characters #! it will extract the absolute path for the executable from this line..i.e. #! …

Member Avatar for gerard4143
0
321
Member Avatar for ubi_ct83

Hi all, My problem is regarding to my last post about argument. that is solved but it create a new problem. The last data in debug_file is not written in output file. I think its because of looping in the argument.How to solve this? [code] int main(int argc, char* argv[]) …

Member Avatar for ubi_ct83
0
111
Member Avatar for Dudani

The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, .... Formally, it can be expressed as: f ib0 = 0 f ib1 = 1 f ibn = f ibn−1 + f ibn−2 Write a C program using the fork() system call that that generates …

Member Avatar for Dudani
-1
7K
Member Avatar for lugan

Hi, First time post here. I understand that you all like to have attempted code, but I just have a conceptual question. My task is to create a C program that takes in a user inputted string and counts the character frequency. I am given a skeleton file with the …

Member Avatar for lugan
0
99
Member Avatar for tquiva

I'm trying to figure out a way I can change this program so that I could have a semi-colon ; instead of \n to indicate the end of a command, like this: a ; b The command is: a The command is: b a The command is: a How can …

Member Avatar for jephthah
0
209
Member Avatar for radical_1982

Hello My problem is that I have to solve a cryptarithm (assign a unique digit from 0 to 1 for each number) where: O N E + O N E = T W O S E V E N is prime E I G H T is a perfect cube …

0
51
Member Avatar for luvmusic202006

Hey I was writing programs in C using turbo C in dos box(vista)....however when i try to compile any program, I get the error: "Unable to include file "header file" I checked but and all the files are where they should be. Please help.

Member Avatar for jephthah
0
76
Member Avatar for ammarZ

I made this really strange and not working code just to count the total number of letters in a string(user inputs then stops with enter), as well as divide each individual character(a, b, c etc) by the total number and show that as well. The reasoning seems right but can …

Member Avatar for jephthah
0
114
Member Avatar for rgpii

Here is my current situation. I have a global array and it is originally declared as an int pointer. I malloc (100*sizeof(int)) to this pointer in the main method. I then use this array to store values and these values are assigned inside of two for loops. The problem is …

Member Avatar for WaltP
0
1K
Member Avatar for unbrknchane

K...so this is an airline reservation program I have been working on for school and I can't see where I am going wrong. Basic functions of this would be taking reservations for either first class or economy class seating on a 10 passanger plane. seats 1-5 are supposed to be …

Member Avatar for mitrmkar
0
149
Member Avatar for newbiecoder

I want my code to take two characters and print them, but this code only takes one character, prints it and terminates, can you please tell me what's wrong with it? Thank you. [code=syntax] #include <stdio.h> int main() { char a, b; scanf("%c", &a); scanf("%c", &b); printf("%c %c\n", a,b); return …

Member Avatar for newbiecoder
0
253
Member Avatar for mutazzaki

HELO EVERY BODY I NEED HELP WITH THE FOLWIN ASSIGNMENT PLZ 1- The programming assignment ( The number-guess assignment ) The main issue of this assignment is to guess a random number in a well defined range. The machine will select a random number; the program will try to catch …

Member Avatar for gerard4143
0
100
Member Avatar for tquiva

When this program prompts the user for input, it works fine for the correct input. But for the wrong inputs, it returns a zero for every character, including the white spaces. My goal of this program is to return a roman numeral as an integer. For the wrong inputs, I …

Member Avatar for WaltP
0
307
Member Avatar for tquiva

I'm trying to get this program to ignore leading tabs and blanks, but I just can't seem to figure out how. What can I further do to improve this program? [CODE]/* Read a command, skipping over leading blanks and any trailing * characters. */ #include <stdio.h> /* Declare functions */ …

Member Avatar for WaltP
0
296
Member Avatar for yabuki

Hello, I just only want to ask.How to connect MS access database to a C program.See the code below: #include<stdio.h> char firstname[20], middlename, lastname[20]; main() { clrscr(); printf("Enter your First Name: ");scanf("%s",&firstname); printf("Enter your Middle Name: ");scanf("%c",&middlename); printf("Enter your Last Name: ");scanf("%s",&lastname); getch(); } This is what I want to …

Member Avatar for shiv1
0
179
Member Avatar for akssps011

The following code when compiled gives the error: "i[B]nvalid conversion from `void*' to `f*' "[/B] What is wrong with it ? [CODE] typedef struct a { int* value; struct a* p; int r; }f; f* m(int* value) { f* node = malloc(sizeof(f)); node->value = value; node->p = NULL; node->r = …

Member Avatar for akssps011
0
111
Member Avatar for gabz16

Please help me to transform this phonebook porgram into a linked list phonebook program with delete function..This is my code... [CODE] #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> struct info{ char name[50]; int TelNo; }; struct info gab[50]; int rec=0; char ch; char search[50]; int c; main() { do{ do{ clrscr(); printf("Phonebook"); printf("\n1 …

0
47
Member Avatar for ubi_ct83

i have this code: [code] int main(int argc, char* argv[]) { remove(debug_file); count=0;//count d number of seeding for (int i = 1; i < argc; i++) { /* Check for a switch (leading "-") */ if (argv[i][0] == '-') { /* Use the next character to decide what to do. …

Member Avatar for ubi_ct83
0
118
Member Avatar for sam_dev

Hey Peeps....... I want help regarding CORE FTP( File Transfer Protocol) Client. i have got its password storage location. it stores it in registry as like this: [B]Hkey_current_user/software/ftpware/coreftp/sites[/B] I want to know that how this FTP encode its password in this file. Do you have any knowledge of its working...any …

0
65
Member Avatar for dondajr

Hi guys o/ ! I'm trying to make a program that write in text file some datas. Then, i wrote a header that have all functions I need to write in this file. thas is my header: [CODE] #ifndef _SNAPSHOT_H #define _SNAPSHOT_H #define LAST_PRICE 0; #define BEST_ASK 1; #define BEST_BID …

Member Avatar for jephthah
0
149
Member Avatar for nateuni

Hi, I transferred Uni, and got an advanced standing for some prior study, but the current unit I am enrolled in builds on an advanced understanding of ADTs (and link lists etc). Problem is that - I have not previously learned this information. My unit text - Algorithms in C …

Member Avatar for Etherwind
0
95

The End.