15,551 Topics

Member Avatar for
Member Avatar for JpegUser

Hi all, Just a simple question. How do i reverse a pointer to a set of values given that i know the size of the pointer? Eg int *temp = malloc(ptr_size); // values of *ptr let say is 1......100, // if i use the algorithm below, it gets me 1..50...1 …

Member Avatar for JpegUser
0
124
Member Avatar for Andragon

Problem1: When I tried outputting a printf "error message" at dividing by zero, it screwed up my code and no output was shown at all. Problem2: When I perform an operation, I get 8 results instead of 5. Please help ASAP. Thanks. [code=c] #include <stdio.h> //Defining a few "functions" which …

Member Avatar for devnar
0
168
Member Avatar for dampecram

Hello, I'm in the middle of writing a doubly linked list, I have the print in reverse working fine and my insert function working fine, I just can't seem to find what I'm doing wrong with the delete function.. WHen i try to delete the last letter in the node.. …

Member Avatar for devnar
0
177
Member Avatar for ajay.krish123

This program is to print name without using the header files [ICODE] void main() { int i; char far *s=(char far *)0xb8000000l ; *(s+2)='p'; *(s+4)='r'; *(s+6)='i' ; *(s+8)='i' ; *(s+10)='t'; } [/ICODE] please explain the meaning of the line [ICODE] char far *s=(char far *)0xb8000000l ; [/ICODE]

Member Avatar for gagansharma
0
182
Member Avatar for revini

Hi all, Can somebody help me pls. I need to create an array of strings using a set of string pointers. char *name1 = "aa"; char *name2 = "bb"; want to make an array like char *nameall[] = {name1, name2}; But this does not work :( Is there a simple …

Member Avatar for revini
0
109
Member Avatar for BITMAN2124

I want redirect output console program to memory. It can be specified memory buffer, or buffer that I can gert ptr to later. I need to specifiy input and output of program and can do this with tmp file+redirect I/O, but that expensive operations+invloves tmp files. I know redirect output …

Member Avatar for BITMAN2124
0
300
Member Avatar for bondo

I have no clue why this isn't working. The top part that reads into size, shortTime, longTime, and threshold work fine. Down below where I try to do the exact same thing and read into x, i get segmentation fault every single time. It seems to me that everything is …

Member Avatar for Narue
0
148
Member Avatar for hellIon

hey guys i am using miracle c compiler on windows xp.... i am trying to figure out how does pointer to functions work..... i have gone thru many tutorials but all have them failed to compile.... [code] #include <stdio.h> int sum(int x, int y) { return x + y; } …

Member Avatar for Narue
0
131
Member Avatar for ting_ting

this is question and the answer...but i cannot compile it in dev c++ correctly..help me //(a) Get five integer numbers from the user. //( Store the numbers in an array called Number. //© Display all the numbers on screen. //(d) Modify the program so that it prints the reverse of …

Member Avatar for Narue
0
136
Member Avatar for SphinCorp

I am getting a casting error with: [CODE] page_directory[0] = page_table;[/CODE] where [CODE]unsigned long *page_directory = (unsigned long *) 0x9C000; unsigned long *page_table = (unsigned long *) 0x9D000;[/CODE] Note that this is to initialize paging at kernel level, so stdlib.h is NOT an option, as malloc() -- a memory allocation …

Member Avatar for Narue
0
73
Member Avatar for mgirl

Hi, My change counting program runs perfectly except the counters don't return to 0 when I try another number. The change adds up from the first try. Is there any way to fix this? [icode] #include <stdio.h> int main() { int toonie=0, dollar=0, quarter=0, dime=0, nickel=0, cent=0; float amount, change, …

Member Avatar for ajay.krish123
0
257
Member Avatar for atman

Hey guys, Im learning C online, and its hard somtimes to understand the concepts, w/o being in class asking questions. I was wondering hat would be the easiest and fstest way to understand numeric validating(no characters) and could anyone break it in easy steps? im new, but really excited about …

Member Avatar for ajay.krish123
0
116
Member Avatar for PoetGuy

Can anyone show me code snippets on linked lists, double linked lists, circular linked lists or something that deals with them. Plus a bit of reading, id prefer functiong codes and not partial please, this is the way i go about learning. Thanks!

Member Avatar for devnar
0
34
Member Avatar for Nashy

Hello people! I have an homework to compile the fax2tiff program. It will be no problem, but how to try my program, if it work? Because I haven't fax file at home, bec. i haven't fax device. I was searching for long time to find some examples for fax files …

0
55
Member Avatar for mikeregas

This program is suppose to be a spell checking program and I just can not get it to work can someone please take a look and let me know what I need to do to fix it [code]#include <stdio.h> #include <string.h> #include <stdlib.h> //CONSTANTS #define wrdlen [48] #define linelen [1024] …

Member Avatar for ArkM
0
171
Member Avatar for srivtsan

i got the code for this problem but not able to find where i am wrong my problem is as follows Given an array of numbers, find the longest subsequence whose elements grow monotonically: 1 4 8 2 5 7 3 6 => 1 4 5 7 1 4 8 …

Member Avatar for srivtsan
0
144
Member Avatar for tat2dlady

I know there is a way for the user to enter input and be able to accept it without the user having to press the Enter key but I do not know the command. Does anyone here know? For example, I have a menu like this: A Add a record …

Member Avatar for Narue
0
113
Member Avatar for yuvaraj.tr

hi gues am new to embedded c,i wrote programm to addition of two numbers but i didn't get the result.... I don't what is the wrong in my code my code is: include <reg51.h> #include <stdio.h> extern unsigned int getnumber (void); extern void output (unsigned int); void main (void) { …

Member Avatar for cikara21
0
85
Member Avatar for atman

Hey guys., i wrote a little program to calculate the foreign exchange of canadian dollar to french frank. but when i validate an input(it has to be between 1 and a 1000), i get a problem even though it makes user to reenter the number, still the very first number …

Member Avatar for bionicseraph
0
157
Member Avatar for asilter

I did not care on warnings. But they put me in trouble lately. When compiler comes to the statement below it gives the warning. [code] /* void ** vpSec00 comes as an argument */ int hSec = 0; size_t nbytes; *vpSec00 = bitio_o_close(hSec0, &nbytes); [/code] it says: warning: assignment makes …

Member Avatar for SphinCorp
0
297
Member Avatar for hajjo

I am doing fork(), I need to send messages between parent & child.. am using this.. char readbuffer[80]; int fd[2], nbytes; if(child == 0) { close(fd[0]); nbytes = read(fd[0], readbuffer, sizeof(readbuffer); index = atoi(readbuffer); } else{ close(fd[1]); sprintf(sending, "%i", index); write(fd[1], sending, strlen(sending)+1); } Index is an integer am sending …

Member Avatar for bionicseraph
0
195
Member Avatar for friendklay

I have got xampp-linux-1.6.7 and xampp-linux-devel-1.6.8a installed on Ubuntu 8.10. I am trying to install mod_wsgi-2.3 and was able to sucesfully run ./configure on it. But when I run make, it gave me a bunch of errors. I am pasting a snipped of it here. [code]mod_wsgi.c:3886: error: expected ‘;’ before …

Member Avatar for friendklay
0
118
Member Avatar for msundastud

once again teaching myself to write using C, damn I miss C++ the question is to write a program that can calculate the first, second, and third quartiles for a set of data. I need to declare 2 arrays, each having 3 columns. The quartiles will be calculated for only …

Member Avatar for msundastud
0
107
Member Avatar for kohuke

Hi. The program works fine if i just compile and run. But for the program to get graded it has to pass a test written in python which it does not. Since i'm complete dummy at c and programming if you find to explain, dumb it down please... so here …

Member Avatar for kohuke
0
130
Member Avatar for gayatri.saha

1) # define cube(x)(x*x*x) main() int x=2. y, z; y= cube(++x); z= ++y + 386 / cube(++x); printf("%d %d %d", ++x, y, z); convert into hexadecimal 2) a = 0*aa b = a<<1 a) b=a b) b= 2a

Member Avatar for WaltP
1
106
Member Avatar for frank*

Do anyone have any idea to write a c progrm which counts no of times it is run without using a updating file??:?:

Member Avatar for ArkM
0
100
Member Avatar for atman

Hello., Im learning C online, and one of the examples from the internet is this: [CODE] #include <stdio.h> int CalcVolume (int length, int width, int height); void PrintIt (int vol); void main() { int volume1, volume2; int x = 8, y = 15, z = 20; volume1 = CalcVolume (10, …

Member Avatar for ajay.krish123
0
108
Member Avatar for Sauron911

Basically what my program does. It has one main. It has one function. The function is: [CODE]int humhum (unsigned long x, unsigned long y) { unsigned long res; printf("Enter an integer for x:"); scanf( "%ul", &x); printf("\nEnter an integer for y:"); scanf("%ul", &y); res = x ^ y; } [/CODE] …

Member Avatar for WaltP
0
84
Member Avatar for shankhs

I am trying to solve a typical 0/1 knapsack problem (using greedy algorithm). In this problem I have to sort a structure consisting of 2 ints (one that contains the value and their corresponding amount I have to minimize the value to get `n' amounts so i need to sort) …

Member Avatar for ArkM
0
160
Member Avatar for Donnovan

hi everyone, I'm trying to write a program that calculates the the fourth sqrt() of an int ..., can someone help me thnxx

Member Avatar for DavidB
0
142

The End.