To scan a and b given below which scanf() statement would we use? why wat is da reason
float a; double b; A. scanf("%f%f", &a, &b); B. scanf("%Lf%Lf", &a, &b); C. scanf("%f%Lf", &a, &b); D. scanf("%f%lf", &a, &b); ...
float a; double b; A. scanf("%f%f", &a, &b); B. scanf("%Lf%Lf", &a, &b); C. scanf("%f%Lf", &a, &b); D. scanf("%f%lf", &a, &b); ...
i have made a program to find the area of a rectangle but it always gives area 0.Dont get why. #include<stdio.h> #include<conio.h> struct rectangle { float width; float length; }rect; void rectangleget(void); void rectangleset(void); void area( void); void perimeter(void); void main(void) { clrscr(); rectangleset(); ...
Hello all, I am starting to learn everything about security and secure programming. I have always heard about things like buffer overflow vulnerability. But I don't know yet how such vulnerabilities are exploited. And how can we program securely enough to make sure that our code is robust. When I say all this, my programming language...
How can I compile C code for use in .NET? There is a game that written in C; how can I convert it to .Net code or use some parts of it? ...
Hi Can anyone point me to online tutorials, parsing apps, etc for converting C code into actionscript3? ...
I'm working on a game engine and I'm too much of a wuss to write image loaders for multiple formats, so my question is this: Is there an abstracted image loading library to load image files? I just need to load files then splat them on to the screen using an array of pixels. ...
I'm recording a mono audio stream using a PIC at 8-bit 8Khz and streaming it raw to another microprocessor that houses a web server. I'm currently buffering the data and turning it into a wav file that gets played in the browser. What I'd like to be able to do is continuously stream the audio as it's being recorded without putting a lo...
Hi, I am new to programming and I am trying to calculate the eigenvector centrality of an directed graph mapping onto a social network. These are large matrices. I know how to calculate eigenvectors and the adjacency matrix associated with the graph. I am just unsure how to combine those two parts to calculate eigenvector centrality. Th...
I'm using Lemon as a parser generator, its error handling is the same as yacc's and bison's if you don't know Lemon. Lemon has an option to define the error token in a set of rules in order to catch parsing errors. The default behavior of the generated parser is to destroy the token causing the error; is there any way to override this b...
I made a program to find if a entered string is palindrome or not palindrome but it always says that its not a palindrome #include <conio.h> #include <graphics.h> #include <string.h> void main(void) { int i,len,halflen,flag=1; char str[50]; clrscr(); printf("Enter a string:\n"); gets(str); len=strlen(str); ...
Ok, I have been reading up on fread() [which returns a type size_t]and saw several posts regarding large files and some issues others have been having - but I am still having some issues. This function passes in a file pointer and a long long int. The lld is from main where I use another function to get the actual filesize which is 644...
Consider the following file: -rw-r--r-- 1 user user 470886479 2009-12-15 08:26 the_known_universe.png How would you scale the image down to a reasonable resolution, using no more than 4GB of RAM? For example: $ convert -scale 7666x3833 the_known_universe.png What C library would handle it? Thank you! ...
What does C++ add to C? What features of the language are the Clang/LLVM projects, the parts of GCC that are being written in C++, chromium, and any others all taking advantage of? What features are they avoiding? ...
I'd like to call a custom function that is defined in a python module from C. I have some preliminary code to do that, but it just prints the output to stdout. mytest.py import math def myabs(x): return math.fabs(x) test.cpp #include <Python.h> int main() { Py_Initialize(); PyRun_SimpleString("import sys; sys.path.appe...
I believe C is generally faster to compile than C++, because it lacks features like late binding and operator overloading. I'm interested in knowing which features of C++ tend to slow the compilation process the most? ...
Hello guys, I am trying to hack an old unix kernel. I just want to implement the MMU and TLB using software. Can some one tell me what are the best Data structures and algorithms to use in building one. I saw lots of people using splay trees because its easy to implement LRU. Is there any better Data Structure ? What is the most efficie...
Here is my issue, I have a scale point, which is the unprojected mouse position. I also have a "camera which basically translates all objects by X and Y. What I want to do is achieve zooming into mouse position. I'v tried this: 1. Find the mouse's x and y coordinates 2. Translate by (x,y,0) to put the origin at those coordinates...
Hello, I have been working with a doubly linked list. Everything works OK with the exemption of the function that should add a copy of 'who' before 'whereX' [see code bellow]. Why is the function not working? void addNodeAt(Node *whereX, Node *who) { //copy Node *temp = (Node*)malloc(sizeof(Node)); temp->count = who->count;...
Hi, I don't know C++ very well especially the IO part. Can anyone please help me to translate the following C++ code into C#? unsigned *PostingOffset, *PostingLength, NumTerms; void LoadSubIndex(char *subindex) { FILE *in = fopen(subindex, "rb"); if (in == 0) { printf("Error opening sub-index file '%s'!\n", subindex); exit(...
I'm having trouble reversing my doublely linked deque list (with only a back sentinel) in C, I'm approaching it by switching the pointers and here is the code I have so far: /* Reverse the deque param: q pointer to the deque pre: q is not null and q is not empty post: the deque is reversed */ /* reverseCirListDeque */ void revers...