19,876 Topics

Member Avatar for
Member Avatar for MooCrow

We've started learning about arrays, but our lecture notes are really not helpful at all and we don't have a book. I'm struggling to understand this question and I honestly have no idea what to do or where to start. I've tried to read tutorials and things but I'm just …

Member Avatar for MooCrow
0
802
Member Avatar for Roelof Wobben

Hello Im trying to learn C rfrom the C book. Now I have this exercise : [code] Write a function that returns an integer: the decimal value of a string of digits that it reads using getchar. For example, if it reads 1 followed by 4 followed by 6, it …

Member Avatar for jl.lakhnai
0
223
Member Avatar for ssaleem1992

i'm a beginner with c... and i need a simple c code to read all the files from a folder in a windows platform

Member Avatar for Narue
0
33
Member Avatar for kirtics344

You’ve been given an assorted set of gears. Each gear has a different number of teeth – the notches on a gear that interlock with notches on another gear to transmit speed. You have a couple of belts one coupled to an input and the other for the output. You …

Member Avatar for maqsood8797
1
168
Member Avatar for asilter

let's say we have a unsigned char pointer with allocated memory of 1 million bytes. Could you give a little code sample which shows how to eliminate first 1000 bytes? the little similar situation is like below: unsigned char array: 12,34,67,99,215,250,123,67 i want to make it: 215,250,123,67 I want to …

Member Avatar for IcantC
1
180
Member Avatar for rEhSi_123

Guys need some advice. I am working on a algorithm for multiple string searching using OpenMp. So within my program I am trying to [U]initialise[/U] each elements of an array to a value of a variable. What I mean by is say if I have array intialised as shown below: …

Member Avatar for Narue
0
104
Member Avatar for Roelof Wobben

Hello, I have this problem. [code] Use the function that you just wrote to read a sequence of numbers. Put them into an array declared in main, by repeatedly calling the function. Sort them into ascending numerical order, then print the sorted list. [/code] So I thought this can work …

Member Avatar for WaltP
0
124
Member Avatar for d_panayotov
Member Avatar for rockerjhr
0
204
Member Avatar for tubby123

guys, we use like a 2-d array very often. But what exactly is the use of a 2-d array ? Now when i look at it, i feel everything can be done using a 1-d array and incrementing the pointer appropriately. Is the only advantage of a 2-d array , …

Member Avatar for rockerjhr
0
152
Member Avatar for Ahmed sunny

Write a program that emulates the DOS COPY command. That is, it should copy the contents of a text file (such as any file) to another file. Invoke the program with two CPP command-line arguments—the source file and the destination file—like this: C>ocopy srcfile.cpp destfile.cpp In the program, check that …

Member Avatar for Arbus
0
962
Member Avatar for s11049151

hey, I have to write a program that asks the user for an input amount (in cents) and the highest denominations of change (1c,5c,10c,20c & 50c). With these 2 inputs, the program then finds the distinct ways in which the change for the given amount can be made using the …

Member Avatar for daviddoria
0
271
Member Avatar for Amr ElGohary

Design and develop a program for balanced delimiters checking . Use the stack class defined in STL. Your program should take from the user the name of the C++ program he wants to check and then opens it and processes its text and issues a message saying that: You the …

Member Avatar for WaltP
0
149
Member Avatar for gaten

Hi, What can I create a list? I would like to know how to insert items in a list. I wrote this code [CODE] void addElem(lista *&head, int elemento){ if(temp == NULL){ head=new lista; head->value=elemento; head->link=NULL; temp=head; }else { lista *new_node=new lista; while(temp != NULL){ temp=temp->link; } new_node->value=elemento; new_node->link=NULL; temp=new_node; …

Member Avatar for NathanOliver
0
36
Member Avatar for batchprogram

I'm doing some homework for a computer systems class and all is well except this one problem that I can't seem to find a solution to due to the limitations. The problem requires me to write a function that performs addition on 32-bit signed integers but saturates the result to …

Member Avatar for rubberman
0
2K
Member Avatar for paprworknotdone

What is causing the C:\Program Files\Common folder to open on boot up? I have to close it every time lately. Sometimes it reopens if I close it too soon. This is annoying. I have Windows XP.

Member Avatar for someone unknown
0
369
Member Avatar for yongj

So one of my assignments is to code a MAKEFILE program. Though we discussed this over in class I'm not sure exactly sure how it works. Here's one of the examples we went over: [CODE] ----------------------------------------------------------------------------- # # DELDIR makefile # Old-style MAKEFILE format. Microsoft MAKE V1.x # Similar to …

Member Avatar for zaraki
0
164
Member Avatar for corneliousfazal

Dear Friends i went a little application for data encryption in c using hill cipher.

0
34
Member Avatar for damusalui

i want to develop railway reservation system in c in file system. Please help me to build the database..... my mail id is [snipped]

Member Avatar for sabananthan
-4
39
Member Avatar for Drakarus

I am trying to figure out how to automatically close a simple windows application in C. I know how to create the window. But I have no idea how to get it to automatically close when it has opened without user input/interaction. Basically when it is called upon, I want …

Member Avatar for chrjs
0
152
Member Avatar for shadowscape

Hello Everyone. i have created a XOR Encryption libary in c...well tried with some help. But there is something wrong with my coding as when i try and decrypt a file, it doesnt always decrypt as plain text as some charfacters seem malformed. Please could you help me fix this …

Member Avatar for rubberman
0
201
Member Avatar for vivosmith

Hello I have been using c for dummies along with bloodshed software for a day or so and I tried putting this snippet of code in from the book and I got a syntax error:[CODE]#include <stdio.h> int main() { char name[20]; char color[20]; printf(“What is your name?”); scanf(“%s”,name); printf(“What is …

Member Avatar for Narue
0
320
Member Avatar for l1nuxuser

hello everybody. i bulding now a software with a data-base i am using MFC lib. i need help how to add, edit & use data base in vc++ tks biny.

Member Avatar for Ancient Dragon
0
204
Member Avatar for Olifant
Member Avatar for Moschops
0
103
Member Avatar for prvnkmr194

Get_Number function is a function to get input from keyboard, this function restrict the user to pass wrong input........... How to use -> For example we need to take input in any integer variable n call Get_Number() like this [CODE] n=Get_Number(); [/CODE] With Full Back Space support Please comments on …

Member Avatar for TrustyTony
-1
285
Member Avatar for shootersix66

Hello. I am making a program in c from the linux nano complier. I made and tested the program in Dev C++ and it works perfect. When I put it in nano, it complies, but when I run it, it gives a segmentation fault. Please tell me how to fix …

Member Avatar for rubberman
0
129
Member Avatar for IwalkAlone

Q.Create an equivalent of four function calculator. The program should request the user to enter two numbers and an operator. It should carry out specified arithmetic operation on the two numbers( using switch case).After displaying the result, the program should ask the user if he/she wants to do another calculation.If …

Member Avatar for lokeshg
0
2K
Member Avatar for wdearth

I have a program assignment where one part requires a user-defined function where you enter a string with a minimum length of 2 characters and a maximum length of 20 characters. How would I get it to find the length (I believe should be stored into index) of the entered …

Member Avatar for TrustyTony
0
172
Member Avatar for n1csaf3

I am having trouble correctly allocating memory for a parent function that will remain upon the child functions exit. the call to the child function is [code=c]HTTP_packToGen((char*)http_headerContent.HTTP ..[/code] the HTTP variable within http_headerContent is a char pointer that isn't allocated until the child function is called, http_headerContent is a static …

Member Avatar for n1csaf3
0
321
Member Avatar for tubby123

I can write char a[] = "hello world"; , but i can not write char a[]; a = "hello world"; why is that ??

Member Avatar for tubby123
0
103
Member Avatar for yashsaxena

Hello All I have some confusion in Declaration and defination of variables. Declaration means ===> where the variables are declared and no memory is allocated. Defination means ===> where the variable is declared and defination is allocated. For eg. if we write (1) int a; printf("%d",a); then it will print …

Member Avatar for nezachem
0
131
Member Avatar for tubby123

Why do we have to initialize a pointer to a string when it is declared globally ? I mean , [B]This doesnt work[/B] [code=c] #include<stdio.h> #include<conio.h> char *str; int main(void) { gets(str); printf("%s",str); } [/code] [B]But this works[/B] [code=c] char *str="1"; int main(void) { gets(str); printf("%s",str); } [/code] Even upon …

Member Avatar for rubberman
0
139
Member Avatar for shanki himanshu

suppose i have 3 functions: a() b() and c() both a() and b() can called c(). if function c() is called how do i know who is the caller??

Member Avatar for rubberman
0
235
Member Avatar for neverine

Hallo, Can somebody help me how to find combination between code´s. i have 30+ codes like this 7zv7pj. xjdcsa, efzlfl, xkaadt etd but i dont know any program or something what can i help me get more combination or understand how codes work. Ty for help

Member Avatar for neverine
0
125
Member Avatar for cse.avinash

[B][U]input:--[/U][/B] 3 hi hello my name is abc this is a test [B][U]output:--[/U][/B] hi hello my name is abc this is a test here is the code:-- [CODE]#include<stdio.h> main() { int n,i; char b[100],*c; scanf("%d",&n); for(i=0;i<n;i++) { gets(b); c=b; while(*c !='\0') { putchar(*c); c++; } printf("\n"); } return 0; } …

Member Avatar for Narue
0
118
Member Avatar for tubby123

Hello people, I am using Turbo-C Can anyone give me a sample program using the bool array I tried compiling the following code snippet. But it doesnt work. [code] #include<stdio.h> #include<conio.h> int main() { bool a[10]={true}; clrscr(); printf("\nHello World"); getch(); } [/code] It gives the error [B]Undefined Symbol bool[/B]. But …

Member Avatar for Narue
0
118
Member Avatar for verdascofernan

Thanks for your post, can anyone post some books describing some valuable function list of C language which are more close to hardware

Member Avatar for octopusgrabbus
0
114
Member Avatar for arundessai

helo m put on a project were in need to do 1)create merge feild in word using c# 2)should able to edit and add this mail mergefield using c# please help

0
30
Member Avatar for mphst

3) Write a program that reads a 21 by 21 array of characters from a text file. It represents a maze. • Each position can contain either an X or a blank. The borders of the maze are covered by ‘X’ except start and exit points. • Read text file …

Member Avatar for TrustyTony
0
960
Member Avatar for darkdai
Member Avatar for abhimanipal
0
92
Member Avatar for tubby123

what does int main() return and to what does it return That is, in the code snippet, [code] int main() { int a=0,b=5,c; clrscr(); c=a+b; return c; printf("%d",c); getch(); } [/code] 1)What is the expected output ? 2)I tried compiling this and i dont get anything on the screen 3)In …

Member Avatar for Ancient Dragon
0
151
Member Avatar for RenanLazarotto

Hey guys! I'm going to start learning C/C++ (again), and I want to start with a very simple program. It should ask to the user a number and, if it is right, run a program. Its been a long time that I don't even touch anything from C, but I …

Member Avatar for Ancient Dragon
0
115
Member Avatar for darkdai

hi all, i have this code which is supposed to display the elements of a char array but the problem is that its displaying funny symbols not the elements. does anyone know why? [CODE]char *list[]={"a","m","t"}; for(i=1; i<=3; i++) { list[i]=(char *)malloc(4*sizeof(char)); } printf("The elements are: "); for(i=1; i<=3; i++) { …

Member Avatar for nezachem
0
108
Member Avatar for shazzy99

Hi, I've written a code to count vowels and consonants. But it hangs and doesn't do anything when a function call is made or even before that at get statement. When I try to get a string from user to pass to the function to count vowels or consonants. Here …

Member Avatar for shazzy99
0
143
Member Avatar for asrockw7

I've made this simple timer/alarm for myself for this game I'm playing. I want to use it to inform me of an automated event a few minutes before it happens. It isn't done yet, but I am concerned with how much resources it takes. From the compiler, it takes about …

Member Avatar for TrustyTony
0
168
Member Avatar for tubby123

i have a doubt. why cannot we use clrscr() before initializing a variable in C? i mean, why wont this work ? void main() { clrscr(); int a,b; ---- ---- getch(); } It'll give an error saying , "Declaration is not allowed here " Logically speaking , you should be …

Member Avatar for Narue
0
145
Member Avatar for madmhan84

[B]Good day everyone,[/B] Hope you could help me on this one The program is running but the result is far from what I want please help me... TIA Like this one: [B]Input:[/B] ------------------------------------ Enter first number: 7 Enter second number: 45 ------------------------------------ [B] Output:[/B] ------------------------------------ 7.45 [B]7.00[/B] ------------------------------------ [B]which should …

Member Avatar for Ancient Dragon
0
125
Member Avatar for garber

[CODE]#include <iostream> using namespace std; int main() { int sum = 0; // Declare an int variable sum to accumulate the numbers int lowerbound; // Set the initial sum to 0 int upperbound; // Sum from 1 to this upperbound // Prompt user for an upperbound cout << "Enter a …

Member Avatar for mir wasif
-1
3K
Member Avatar for wonkerloop

I have tried to make a program that allows inputs into a 1D array. I run the program and the inputs are asked for, but the program simply continues to ask for more inputs. I'm moderately new to C so go easy. Any help would be appreciated Cheers Wonkerloop Heres …

Member Avatar for yashsaxena
0
166
Member Avatar for lochnessmonster

how would i assign the following functions address to a function pointer? int sum(int x, int y) { ... }

Member Avatar for abhimanipal
0
58
Member Avatar for maybnxtseasn

typedef struct _FOO { int blah; int blah2; int blah3 } FOO, *FOO; 1.) Does this create 2 objects of type FOO and another that is a pointer to a FOO? 2.) OR does it just typedef the names so you don't have to do the following struct __FOO fooStruct; …

Member Avatar for abhimanipal
0
117

The End.