15,552 Topics

Member Avatar for
Member Avatar for 1150

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 …

Member Avatar for Adak
0
115
Member Avatar for Anuradha Mandal

[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 …

Member Avatar for Narue
0
87
Member Avatar for shadowscape

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 …

Member Avatar for nmaillet
0
125
Member Avatar for Gaiety

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?

Member Avatar for lyfzopen
0
188
Member Avatar for amrita111

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } how will it work?please explain..

Member Avatar for jnawrocki
0
97
Member Avatar for sydsine

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...

Member Avatar for himgar
0
324
Member Avatar for bubbinos

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 …

Member Avatar for Adak
0
209
Member Avatar for rom.

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 …

Member Avatar for rom.
0
394
Member Avatar for cse.avinash

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 …

Member Avatar for TrustyTony
0
275
Member Avatar for D33wakar

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*/ …

Member Avatar for Narue
0
228
Member Avatar for coder_naive

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 …

Member Avatar for coder_naive
0
157
Member Avatar for mullan123

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 …

0
107
Member Avatar for h.senan

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 …

Member Avatar for Narue
0
509
Member Avatar for Museless

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 …

Member Avatar for thines01
0
164
Member Avatar for kooletz

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 …

Member Avatar for gusano79
0
171
Member Avatar for Uma_CSPL

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 …

Member Avatar for Anuradha Mandal
0
106
Member Avatar for KOFguru

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 …

Member Avatar for ashwin k v
0
212
Member Avatar for Jamblaster

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 …

Member Avatar for Anuradha Mandal
0
210
Member Avatar for dotancohen

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.

Member Avatar for dotancohen
0
128
Member Avatar for pinkannu

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 …

Member Avatar for pinkannu
0
189
Member Avatar for ineedsomehelp:3

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 …

Member Avatar for Adak
0
124
Member Avatar for lastbencher

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

Member Avatar for mitrmkar
0
306
Member Avatar for Mahesha999

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]

Member Avatar for Adak
0
145
Member Avatar for digitalhead

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 …

Member Avatar for ashok.bandari88
0
219
Member Avatar for hqt

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, …

Member Avatar for keshvari
0
140
Member Avatar for reza.adinata

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] …

Member Avatar for reza.adinata
0
184
Member Avatar for keshvari

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 …

Member Avatar for keshvari
0
129
Member Avatar for hqt

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 …

Member Avatar for Narue
0
161
Member Avatar for theguitarist

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 …

Member Avatar for Narue
0
158
Member Avatar for Efficience

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: …

Member Avatar for Efficience
0
451

The End.