15,552 Topics
| |
Can anyone help? New programmer trying to write Program that prompts user to enter name of file to display on screen. User is given to option to display another file until the user ends program. it is not working and. After compilation when 1 is chosen it scroll the question … | |
[B]Input[/B] The input begins with two positive integers n k (n, k<=10^7). The next n lines of input contain one positive integer ti, not greater than 109, each. [B]Output[/B] Write a single integer to output, denoting how many integers ti are divisible by k. my code is......... [CODE] #include<stdio.h> int … | |
Hello, i have created a Xor function for a DLL i am developing. I have a problem with this function as the decoded text isn't matching its original state and i am unsure as to the cause of this, please could you help me? [CODE] #define export __declspec (dllexport) #include … | |
Hi, if any one has any idea "how the switch statement works". does it maintain any tables internally or any other machanism? and is there any way to make the switch statement efficient? | |
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } how will it work?please explain.. | |
plz solve ... [CODE]int main() { const int m=10; int &n=m; n=11; printf("%d%d",m,n); }[/CODE] can w declare &n...its not an error... | |
Here's what I'm trying to do. I'm making a program that uses an array to store a deck of cards. I have other code written that converts a number between 1 and 52 into numbers and suits. My only issue is that my code to randomly put numbers into the … | |
I'm just starting out in C/C++, and I want to make a simple socket server script. It will be compiled on mac/linux and executed from terminal. Just want a simple script that will: - allow multiple clients to connect to the server on a specified port (they will be using … | |
Can any one help me to know how to deal with big numbers, like to count the number of digits in factorial of 5*10^9. or how to make number 20,000 decimal. array can store only to 10^6, if heap is taken the size could extend up to 10^9.How to deal … | |
I am trying to write a program for searching strings(one at a time)in a text file. To start things off, I wrote this one. [CODE] #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> int main() { FILE *txt_file; int chr;/*char read by fgetc*/ int word_match=0; const char* substring ="window";/*search word*/ … | |
I wrote this simple code in devc++. On compiling, the computer is showing syntax error at line int P = rand(); ... while the same line, if I write in the main function gets compiled easily. Please tell me what's going on! [CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> struct poclick … | |
after tokenising my string i am the tokens to the method below and counting the tokens. if token number is one, that means i have one command only and pass it from execvp.. if i have a second token then pass that token from the second execvp.. This gives me … | |
Hello Guys! I am suffering with xcode compiler while i am compiling the below code. At first the problem was on getch( ) and ungetch ( ) , then I have been advised to use getc/fgetc Now the error massage is: error: expected identifier or '(' before '{' token Thank … | |
I am trying to find out how to replicate the output of fwrite("andbe", 4, 1, output); an encryption algorithm I am using writes its output as this, but I am sending data across a network, and need to be able to write this to a string to send. The algorithm … | |
i have an assignment to create a program. Mang Tomas paid a certain amount of Bushels of wine to be delivered this weekend for his promotional party. What will the rate of each Bushel of Beer and how much dicount will be given to them? [CODE]Number of Bushels Discount 1 … | |
I am opening a file in read mode and reading continuosly after a time interval from 9AM to 4PM. Two problems exist: (1) Few lines from the file have been missed for certain time interval alone, able to read the contents after the missed lines. (2) Continuously checking the file … | |
I am having problem with `clrscr' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.) when I am compiling it in DEV-C++ .....please let help me with these [CODE]#include <stdio.h> #define p print f #define s scan f main() { int … | |
First off let me say that I am a student and do not want any answers. What I do want is some help understanding why my logic isn't working so I can devise a new plan. Any help at all would be greatly appreciated because I am completely stuck atm … | |
Many functions in C have been "improved" with versions that have n, l, or other characters in their names. For instance, strncat and strlcat which improves strcat. What is the significance of the letter n or l in these names? Thanks. | |
I have a very big string "-dAwin Main_Window -dwin Widget_Window -dh 500 -dw 300 -da 100 -dv 10 -dint 2............" This string gives me input parameter for running my application.Example -dAwin Main_Window gives me application window name. -dAwin is identifier b'coz this sequence may change or number of parameters may … | |
Ok, I have a program that gets the factors of a LCD of a number (recursion). I need help converting it to loop statement :( . Any help will be appreciated. and please add an explanation I would really appreciate it. [CODE]#include<stdio.h> #include<stdlib.h> void whatIs (int nNum) { int nF … | |
Hi I installed Visual C++ 2010 express today. There is no option to create a .C file. I tried googling but found nothing. Please help me with this | |
Hi this program accepts the string from the input. I cannot understand the highlighted format specifier. Please help me understand. [CODE]#include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char str[15]; scanf("[B]%[^\n][/B]",str); str[0]=toupper(str[0]); str[15]='\0'; printf("%s",str); putchar(123); getch(); return 0; }[/CODE] | |
Hi, I wanted to write a C program which searches for text files in a directory(assuming the directory and files are not write protected),list them and open each one of them(files) write a letter A in them.Can anyone give me a sample code. I believe it can be done with … | |
I have two declare of pointer: [code] Pointer *a,*b,*c; int i=5; *b=i; a=b; c=&b; [/code] at line (a=b) mean a will point to what b point (mean point to int i) at line (c=&b) mean c will have address of b, mean c will be pointer to pointer b. So, … | |
Hi all, I am a newbie in C, and a bit curious with this "goto" statement. For instance, I create a simple code below [CODE] #include <stdio.h> int main () { int a; a = 1+1; if (a!=2) { goto error; } error: printf("error is here\n"); return 0; } [/CODE] … | |
Hello I write program that can solve linear equations with LUP decomposition method.I know that my algorithm is true and every part of my program do what I want. when I call function lupDecomposition() inside the lupSolve() the program crash.This is my related code: [CODE] int makeUpperDiagonal(Matrix * src){ int … | |
I have something that I don't know how to use the Pointer, this is my code: [CODE] struct node{ int data; struct node* next; } struct node* BuildWithLocalRef() { //give a list with: 1 2 3 4 5 //and your work is import this list in to Linked List with … | |
Hello I am very confused with how negative numbers are represented in binary form. They say it is done in 2s complement form. Now won't this 2s complement of a negative number clash with an actual +ve number having the same binary representation? And negation of a +ve number..... We … | |
I have written this C code in which I'm declaring a variable inside switch body with initialializing it to 10.But when I'm running this code it is printing some garbage value. [CODE]#include <stdio.h> int main() { switch(2) { int x=10; case 1: printf("Case 1: %d\n",x); break; case 2: printf("Case 2: … |
The End.