15,550 Topics

Member Avatar for
Member Avatar for daudiam

ptrdiff_t is signed, while size_t is not, but both can safely hold the address of a pointer. How is it possible when half the possible values of ptrdiff_t will be negative, so its capacity must be half of that of size_t when it comes to storing pointers, as pointer adresses …

Member Avatar for Narue
0
267
Member Avatar for Derp2000

Hello there. :) I tried all day yesterday to figure out what was wrong with this code so I thought I'd ask here. I have to write a program that duplicates a 24-bit (RGB) bitmap file while also inverting the image. The only problem seems to be copying the pixel …

Member Avatar for Salem
0
150
Member Avatar for sweetanimeshrcc
Member Avatar for jezareal

Hi. im just quite new to c program and i need help on who can give me the source code. This is about Interval search method or OSM in numerical method analysis. The program should solve a given equation f(x) example: f(x)= x^2+2x+3 Given the function f(x)=0 (this would be …

Member Avatar for Dave Sinkula
-3
257
Member Avatar for sree_ec

I have a general doubt regarding passing pointers to functions... Suppose i have variable [code=c]tc_struct *ptr;[/code] and i want to pass it to a function to fill it. So i passed it [code=c]func(&ptr);[/code] and i received it in func as [code=c]void func(tc_struct** ptr1)[/code] Now again i want to pass this …

Member Avatar for Narue
1
340
Member Avatar for daudiam

There is a rule about sequence point that goes like this. "Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored." …

Member Avatar for Narue
0
95
Member Avatar for daudiam

I think getch() is the most primitive input function of C, on which getchar(),etc. are based. What may be happening is that getchar() uses getch() to take input, and keeps buffering it till getch() returns 26 (ascii for ctrl+z, which indicates the end of input in Windows) is encountered. It …

Member Avatar for nezachem
0
145
Member Avatar for daudiam

size_t is defined as "size_t type is a base unsigned integer type of C/C++ language. It is the result of sizeof operator's execution. The type's size is chosen so that it could store the maximum size of a theoretically possible array. On a 32-bit system size_t will take 32 bits, …

Member Avatar for Dave Sinkula
0
192
Member Avatar for Gonbe

Hello. I'm writing a program in C that should ask for a line of input, and extract the process name and parameters. This doesn't have to be totally bulletproof at this point. An example input could be: "Hello these are parameters". On this example "Hello" would be the string i …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for SecurExpert

someone please help me out on this linked list code. it seems not to work out. it is sort of a doubly linked list. look it out. [CODE] #include<stdio.h> #include<stdlib.h> int count = 0; struct node_ptr{ int value; int no; struct node* back; struct node* next; }; struct node_ptr* root; …

Member Avatar for Salem
0
113
Member Avatar for swathi430

in my project if a student gives login and password he should get the details of the student as well as placements detalis which we put the database in some files

Member Avatar for Salem
0
32
Member Avatar for xavier666

I just made a 'Hello World' program [code] #include<stdio.h> int main() { printf("Hello World\n"); return 0; } [/code] [code] exe file size = 15.5 KB Source file size = 79.0 B [/code] Then i made a data structure program (implementing stack, queue, deque) [code] exe file size = 21.9 KB …

Member Avatar for xavier666
1
170
Member Avatar for astropirate

Greetings all! I have a question which after hours of googling i could not find an answer to. In a winsock enviroment, how does one get the udp packet's checksum from the header? thanks!

Member Avatar for astropirate
0
63
Member Avatar for Iam3R

Hi , so far i have been concentrating on programming aspects. now its time to learn some internals of C -compiler. Lexical Analyzer Parser Hashtables Syntax Checkers Expression Evaluators Symbol table : etc please share me some info related to symbol table what are the contents of the symbol table …

Member Avatar for Iam3R
0
163
Member Avatar for john butler
Member Avatar for Narue
0
155
Member Avatar for cthoes

[CODE] while(1){ system("clear"); gotorc(10,30); printf("\n1. add records"); printf("\nyour choice"); fflush(stdin); choice=getchar(); switch(choice) { case'1' : fseek(fp,0,SEEK_END); another='y'; while(another=='y') { printf("\n Enter name, age and basic sal"); scanf("%s%d%f",e.name,&e.age,&e.bs); fwrite(&e,stsize,1,fp); printf("\n add another record(y/n)"); fflush(stdin); another=getchar(); } break; [/CODE] [QUOTE] hi friends i am working on one menu driven program and used …

Member Avatar for WaltP
0
231
Member Avatar for vishalwiw@mail.

Hi all, I was trying to write a C program which round off the decimal number, here main intension is decimal digits can be of N digits. So problem I was facing to get last digit on which I have to take decision. Please check below C code - suppose …

Member Avatar for WaltP
0
142
Member Avatar for Crushyerbones

Hello guys, I'm trying to make this work [CODE]all: daemon client daemon: cd ./daemon; make daemon client: echo going in cd ./client; make client clean: cd ./daemon ; make clean cd ./client ; make clean[/CODE] But I'm having 2 problems: 1) Make ALWAYS tells me there's nothing to be done. …

Member Avatar for Crushyerbones
0
134
Member Avatar for cthoes

[QUOTE] fwrite writes only name from the structure emp and rest of them are written garbage value to the file. so it would be really great if any one of you can help me out[/QUOTE] [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ FILE *fp; char another,choice,useme; struct emp { char name[40]; …

Member Avatar for gerard4143
0
266
Member Avatar for Pamilerin

Please I have a little problem with my project. It goes "A polynomial of degree n is represented as Pn(x)=A0 + a1x + a2x2 + … + anxn Where a0, a1, a2, a3 , … , an are constant coefficients. Evaluation of such polynomials may be important if Pn(x) is …

Member Avatar for mvmalderen
0
74
Member Avatar for gerard4143

One day while pondering about C I came up with this program. Can you predict what the answer will be? Now run it, were you right? filename.c [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { unsigned long *iptr = (unsigned long*)0;/*pointer equals 0*/ unsigned long ans = (unsigned …

Member Avatar for gerard4143
0
141
Member Avatar for leegeorg07

Hi, I am trying to make a sublime text plugin to compile C using a make file, unfortunately it is all in python and I cannot get things to work :( could you please give me advice on passing data to the g++ make command? Thanks in advance.

Member Avatar for vegaseat
0
100
Member Avatar for msr

Hello, Im using threads in a recent project. I would like to know whats the difference between: pthread_kill() and pthread_cancel() What are the effects of each one? Thank you!

Member Avatar for Vijikumar
0
2K
Member Avatar for vijayshree21

Hi every one, I m doing some work in fractal image compression, plz tell me how to convert a c code to matlab code

Member Avatar for NicAx64
0
5K
Member Avatar for iru

Gentlefolk, Totally new to the world of C C++, compilers and linkers. I am attempting to compile and build some demonstration application code which access BlueTooth devices. Have all the .C, .H files, also a .lib. Using the LCC c ide-compiler-linker, etc on Windows-32 Compile one module - no errors. …

Member Avatar for iru
0
273
Member Avatar for daveoffy

I have been working with popen to run iwlist and get essid from the output but that is making the code sloppy. Is there an API I could use instead to get SSID and other information? Iwlist is in the package wireless-tools in linux Thanks.

0
60
Member Avatar for lisedaton

hi all!!!! im trying to do strcmp to a char in a structure and and char* and im getting a msg error: dereferencing pointer to incomplete type.... can somebody explain me what is that and give me an idea how to resolve it? thanx in advanced!

Member Avatar for Narue
0
131
Member Avatar for daudiam

In undefined cases, anything can happen, the program can crash, or unexpected results be thrown up. What happens is up to the compiler. In unspecified cases, the Standard has deliberately not defined the exact behaviour of a few things so that the compiler is at liberty to do as it …

Member Avatar for Narue
0
166
Member Avatar for daudiam

[code=c] printf ("%d",EOF);[/code] This gives me -1 [code=c]scanf ("%d",&a);[/code] [code=c]printf ("%d",a) [/code] where a is int (as EOF is an int), this gives me some junk value [code=c]printf ("%d",getch());[/code] This gives me 26 I've always given the input as ctrl+z (that's right, na!) What's the correct value of EOF ?

Member Avatar for Narue
0
139
Member Avatar for uzair ahmad

Hello, I have a problem of with game of life source code in C. I need a source code for game of life in C programming language Kindly send me a source code so that i can check my own source code.

Member Avatar for Ancient Dragon
-3
135

The End.