15,551 Topics

Member Avatar for
Member Avatar for vicky_dev

Hi all, what exactly is segmentation fault or access violation and exactly when does it occur? Why does the following program work correctly : [code] #include <stdio.h> #include <conio.h> int main( ) { int a[5]; a[20] = 20; a[-20] = 30; printf("%d %d", a[20], a[-20] ); getch( ); return 0; …

Member Avatar for Salem
0
73
Member Avatar for degamer106

Yesterday, I posted a similar problem (involving numbers) which was solved by Clinton Portis (Thanks by the way) which involved several if statements. This time I got one with a string :rolleyes: If there's some kind of space saving technique please let me know :mrgreen: [CODE]#include <stdio.h> #define SIZE 5 …

Member Avatar for degamer106
0
88
Member Avatar for jack223

The class Chevrolet inherits from the class Automobile. Both have implemented a function called DownShift(). Suppose carPtr is declared as: Automobile *carPtr; The carPtr object can point to both a Chevrolet or an Automobile. We want the call carPtr -> DownShift() to call the right version of DownShift based on …

Member Avatar for Narue
0
92
Member Avatar for shahnazurs

Please help me. Kindly tell me how to open image file in windows from C programming Many Thanks, Shahnaz

Member Avatar for shahnazurs
0
115
Member Avatar for degamer106

OK I wrote this dice program up and it works really well. Just curious though if there was a way to reduce the number of "if" statements. [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> #define SIZE 11 #define TOTAL 36000 int main(void) { int cnt = 0; int die1, die2, sum; …

Member Avatar for degamer106
0
112
Member Avatar for degamer106

Here's a simple program I wrote. [CODE]/* Use a single-subscripted array to solve the following problem. A company pays its salespeople on a comission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $3000 in sales …

Member Avatar for degamer106
0
148
Member Avatar for Yustme

Hi, Im trying to make a function that flip bits. There is not much usefull to find on the net about this. Like an example of such function. Does anyone have a function that flipbits? Thnx in advance!

Member Avatar for Narue
0
2K
Member Avatar for degamer106

Ok..this problem is kind of confusing because I have to use these 2 functions getc() and ungetc(). What i'm supposed to do is take in input in the form of a string, find all digits, store the digits in the string, convert the string into a digit, and finally print …

Member Avatar for Narue
0
454
Member Avatar for perlsu

I would like to know whether the dynamic memory pointer is still available even after freeing the allocated memory. If I want to allocate and deallocate so many times within a loop , I receive memory corruption. Pls help me how I should do.If I call "free" more than one …

Member Avatar for Narue
0
94
Member Avatar for jack223

[Code] Class B { public: int e(); void f(); private: int x; }; class D: public B { public: void h(); void g(); private: float y; } [/code] How many public methods does class D have? is it 2 or 4? void h(), void g() and i'm not sure about …

Member Avatar for Lerner
0
91
Member Avatar for degamer106

OK..so here's the problem... I'm supposed to create a program that reads a text file containing 5 lines, each composed of a name, a colon, and three integers. For example: Bill Gates: 10 20 30 Shalla Booger: 80 70 84 Hagar Joe Plinty: 70 90 80 Darth Vader: 60 50 …

Member Avatar for Narue
0
125
Member Avatar for neo69potato

ok basically me and a friend are learning C language and we're totally stuck on this problem in the textbook and want to get around it before moving on. We're totally useless so a nudge in the right direction or any help at all would be awesome. heres the problem: …

Member Avatar for neo69potato
0
342
Member Avatar for musicmancanora4

Hey guys im making a calendar program where you enter a month 0 to display all months for that year... 0 - 12.. 1 being janauary etc and then entering the year. Similar to the cal command in unix sun on tue wed thu fri sat 1 2 3 4 …

0
89
Member Avatar for Eng_Girl

Hi, I'm new to this fourm I want to ask if anyone can help.I have a program for a GPS receiver it is in C ,for testing I assume the string of GPS message, it doesn't have any errors but it didn't run I don't know why. I used the …

Member Avatar for iamthwee
0
121
Member Avatar for srishekh

could u tell me the problems in defining a 3D double array. that is double a[1000][1000][1000]; While running the program, it gives segmentation fault errror. Please tell me , wat should be the limit of the array or how to come arround this. Thanks and Regards srishekh

Member Avatar for andor
0
60
Member Avatar for musicmancanora4

Im using an ansi c compiler all the errors using gcc -ansi -Wall -pedantic should work without warnings and errors. Running on unix

Member Avatar for Ancient Dragon
0
87
Member Avatar for musicmancanora4

Hey guys sorry for posting the whole code again.. How i can get my calenda program working from here? Because its not printing anything its only printing the mon tu wed etc but not the days of the month 1 - 31 and im not sure if its worked out …

Member Avatar for Ancient Dragon
0
93
Member Avatar for niteshq

Hello, Everybody. Myself is Nitesh. I have joined this group earlier. Please provide me ebook of C language. Thanking You, Nitesh

Member Avatar for iamthwee
0
31
Member Avatar for dors_zone

here are the question: write a program that inputs a series of integers and passes them one at a time to funtion even, which uses the modules operator to determine whether an integer is even. The function should take an integer argument and return true if the ineteger is even …

Member Avatar for dors_zone
0
102
Member Avatar for nemo

what are the two issues involved with multiple inheritance? i know of one, the diamond problem, what's the other?

Member Avatar for Narue
0
63
Member Avatar for musicmancanora4

Hey guys i need to find out how many days there are in a particular month in a particular year. How can i start building an algorithm like that im having some trouble?

Member Avatar for Bench
0
86
Member Avatar for iamboredguy

we have a project in our class to design a sliding numbers game similar to this one: [URL=http://www.eatmygames.com/gameinfo.asp?id=24puzzle]http://www.eatmygames.com/gameinfo.asp?id=24puzzle[/URL] the only difference is that the number of blank spaces is user input (max=n/2 where n: no of elements in a row/column). we have to design an algorithm to make the computer …

Member Avatar for iamthwee
0
176
Member Avatar for musicmancanora4

Sorry guys i apologize for posting large code but im trying to pass the int daysOfMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31} variable array to the totalDays function so i can do some calculations. But i keep getting a seg fault. [code] int main(void) { unsigned month; unsigned year; unsigned long days = 0; …

Member Avatar for Salem
0
148
Member Avatar for nabil1983

Ok i finished off the program i was making. now i just got a couple problems icant work out....spent hours doing this please help me with my last few probs... First thing is when i write the records to file, and then when i try to sort it...the display shows …

Member Avatar for dwks
0
225
Member Avatar for d_gabs123

Hi there, I really need your help. Who knows or who has a code for Hangman game in "C" Language. Please I badly need your help. Thanks.

Member Avatar for Salem
0
56
Member Avatar for musicmancanora4

Hi guys im having a slight problem passing the month and year variable to a function that i have created called int totalDays(unsigned year, unsigned month) now when i do a print inside the function it prints 0. Even though i have inputted using a key for example 6 for …

Member Avatar for andor
0
102
Member Avatar for vurdlak

I started wrting c lessons for absoulute begginers to advanced users, I think material can be considered quality, and my students learn programming with this stuff. If you wish feel free to start reading it.Its only 8 lessons for now so maybe could be easier for you to start following …

Member Avatar for iamthwee
0
133
Member Avatar for some one

hi every 1 i wanna to ask about sigl and double linked list *what is the advanyages and desadvantegs of the double linke list *when we use the double and when we use the single thanks

Member Avatar for some one
0
84
Member Avatar for chelo77

I have problems in how can i use the backspace key work in deleting characters in real time. I have a program where you can type a string no more than 60characters but say i don't want the last character and want to delete it, if i hit backspace it …

Member Avatar for iamthwee
0
207
Member Avatar for Vagabond

Greetings I've been faced with this problem may be you could help? [CODE] [B]class[/B] CalculatorObject : [B]public[/B] TDialog { [B]public:[/B] StateType CurrentMode; [B]char[/B] Operator; [B]char[/B] DisplayBuffer[DisplayPlusSign]; [B]BOOL[/B] Negative; [B]BOOL[/B] InputIsADigit([B]char[/B]* input); [B]double[/B] Operand; TBrush CalcBackground; .....[/CODE] I need to change char DisplayBuffer into a character pointer instead of a character …

Member Avatar for Ancient Dragon
0
130

The End.