19,876 Topics

Member Avatar for
Member Avatar for student125

I have to accept user input, a string, into a doubly linked list and print the output reversed and forward. My professor gave us the following program and told us to modify it. However, I cannot figure it out. /* Program to reverse a doubly linked list */ #include <stdio.h> …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for GaryWazHere

Hello, I'm trying to make my maze game object-oriented. The problem is my mazeArray. I'm a bit confused on how to use it correctly to draw out my maze. Map.h: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <process.h> #include <cstdlib> #include <ctime> using namespace std; #pragma once class Map { …

Member Avatar for tinstaafl
0
495
Member Avatar for moataz_elghoul

Write a code by if statement that inputs five numbers and determines and displays the number of negative numbers input, the number of positive numbers input and the number of zeros input.

Member Avatar for rubberman
0
60
Member Avatar for tyler.dahle

void boss_animation() { for (int i = 0; i < 4; i++){ if( ! boss[i].drawable) continue; //Puts image of character on screen based on inputs from struct readimagefile(boss[i].frames[boss[i].currentFrame], boss[i].xCoord, boss[i].yCoord, boss[i].xCoord + boss[i].charWidth, boss[i].yCoord + boss[i].charHeight ); boss[i].currentFrame++; //increments the "frame" by one, thus only animating one image at a …

0
126
Member Avatar for mayankjain05

does bool work in c(by this i mean a data type that can take only two states 0 or 1 in order to save memory)? if yes then is it included in stdio or any other file is required to be included? same doubt for c++ also mention the syntax …

Member Avatar for mayankjain05
0
163
Member Avatar for student125

I want to know how I can implement a function to open a file and read its contents into a linked list, and then print the contents reversed #include <stdio.h> typedef struct stack { char b[100]; int top; }stack; void push(stack *s,char k) { if(s->top==99) printf("\n Stack is full "); …

Member Avatar for Ancient Dragon
0
863
Member Avatar for sanchit.saxena9450

Hey guys i want to pick up a string from cmd . I am using C language and IDE as codeblocks. Basically i want to firstly ping an ip address and this i will be doing by simply writing "system("ping <ip address>")" . Then on console i will get the …

Member Avatar for sanchit.saxena9450
0
145
Member Avatar for Bchandaria

Can any one help me out to provide code for a following matrix for N numbers? 12345 21234 32123 43212 54321 Please Help me out for this matrix

Member Avatar for Moschops
0
110
Member Avatar for darkocean

Whenever I want to delete row my excel file in c#. I have get error. I tried much much codes on the net but I can not solve my problem. Please solve my problem... Regards,

Member Avatar for santiagoivan.santana
0
9K
Member Avatar for nesa24casa

Hello, how can i split binary data in sections using Binary or Stream Reader/Writer? 115522330000000000552266968966458788220000115522330000000000453266869966458788220000115522330000000000552266968966458898350000 Example is above There are 3 sections in bin file and each start with same template/header 11552233 Thanks in advance

Member Avatar for ddanbe
0
68
Member Avatar for jamesly89

im pay $30 to some that can finsh this for me Project #1 and #2 Specifications You are required to design a calculator. This calculator reads commands from data files called CommandsProj1.dat and CommandsProj2.dat, which I will email to you. Your program should read the commands in sequential order, process …

Member Avatar for <M/>
-3
213
Member Avatar for krebz

Hi Experts, I've got a school assigment in c language programming but this course is new to me. Q. Create 5 users - the 5th user would be the admin Admin would have privilledge to view user profile and disable user account. User Profile: Name, D.O.B, Gender, Occupation, Contact, Income …

Member Avatar for krebz
0
147
Member Avatar for sai.aleenus

x = constant(c)/n where x and n are variables.as n increases x decreases.initially n is taken as n1 and x1 is found out. note: n is supposed to be an integer. how can i impose the constraints of x >= 4 and x <= 14 on the above equation to …

0
90
Member Avatar for alex910TN

Hello, I have an issue I am not sure how to handle. I am trying to call a function from within another function but I get the following warning "2129 [Warning] implicit declaration of function " I have defined prototypes for all my functions at the very start of main, …

Member Avatar for Ancient Dragon
0
140
Member Avatar for you207

Sample input: hello world a b c d Sample output: hello a world b c d Im stuck in a infinite while loop(while(j<maxStr+2)) and i need help to get out of it.Please help! Here is my code: #include "stdafx.h" #include <string.h> #define MAX_STR 5 int _tmain(int argc, _TCHAR* argv[]) { …

Member Avatar for Banfa
0
226
Member Avatar for keval_hack

hi, [CODE] #include<stdio.h> #include<conio.h> struct cricket { char name[10]; char teamname[10]; float batavg; }c1[5]; void main() { int i,j; clrscr(); for(i=0;i<2;i++) { printf("Enter name:"); scanf("%s",c1[i].name); printf("Enter Team Name:"); scanf("%s",c1[i].teamname); printf("Enter Batting avg:"); scanf("%f",&c1[i].batavg); } for(i=0;i<2;i++) { printf("%s\n",c1[i].name); printf("%s\n",c1[i].teamname); printf("%f\n",c1[i].batavg); } getch(); } [/CODE] When i running the above program which …

Member Avatar for chiragkhimani
0
300
Member Avatar for modarbz
Member Avatar for DeanMSands3
-3
161
Member Avatar for annefr

Hello I am working on this project and I am having great difficulties could anybody help me please ??

Member Avatar for annaharris
0
79
Member Avatar for blackrainbowhu

Hello everyone! I hope that someone could help with my C assignment. The main task is to demonstrate forking, piping, message queues, signals, and shared memory with an example that a rabbit female is waiting for a rabbit boy to tell her a poem, she gives a gift in return …

Member Avatar for blackrainbowhu
0
381
Member Avatar for ConfusedLearner

For some reason my program is not working and dont know how to solve this problem. In line 15 the "users" is underline in red and will not run. Please help. #include <iostream> #include <cmath> #include <iomanip> #include <string> #include <fstream> #include <C:\Users\N.\Desktop\Popcorn\Popcorn\JJ.cpp> using namespace std; int main() { fstream …

Member Avatar for Schol-R-LEA
0
166
Member Avatar for bluekb

#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 typedef struct { char *name; int score; }RECORD; float calMean(RECORD list[], int count); void sortData(RECORD list[], int count); int main (void) { // Declarations float mean; float median; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count …

Member Avatar for bluekb
0
169
Member Avatar for Marvels

I'm pretty new at making a windows application (ASP background). I have successfully developed a small WinForm application that does nothing fancy. It runs fine it debug mode and operates as expected. I build the solution and is produces the executable in my release folder bin\release. I can then run …

Member Avatar for ddanbe
0
212
Member Avatar for sai.aleenus

can someone help me with the development of a hook and jeeves pattern search optimisation in c programming with graphical visualisation in step wise. a function bhp is to be minimised by effective selection of 2 parameters x1 and x2 while bhp has been passed x1 ans x2 as arguments …

Member Avatar for Schol-R-LEA
0
711
Member Avatar for cthajeb

Hi, I am writing a sudoku solver program that uses recursion to solve all the empty cells. However, I have no idea why my function did not do anything. I read in my puzzle as double char array and convert it to double int array. My output is : 900020750 …

0
293
Member Avatar for boris90

Hi! Below is a part of my code, and whenever I this part of code starts executing, an error ocurrs! I get this error: [click here to get a error screenshot](http://i.stack.imgur.com/loBcH.png) whenever I add the *ios:app* parameter after the *userScore.csv* part, except that my file isn't QueryLanguage.Lib.dll, but rather something …

Member Avatar for boris90
0
441
Member Avatar for ikhushee

#include<stdio.h> #include<time.h> #include<conio.h> #include<string.h> #include<math.h> #include<stdlib.h> int p,q,r; int i,t[100],t1[100],t2[100]; char M[100],C[100]; int phi,n,e=53,d=11; int cipher(int t) { int i,temp; temp = 1; for(i=0;i< e;i++) temp = temp * t % n; temp = temp % n; return temp; } int plain(int t) { int temp,i; temp = 1; for(i=0; …

Member Avatar for JasonHippy
0
123
Member Avatar for bluekb

#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 float calMean(RECORD list[].score, int count); typedef struct { char *name; int score; }RECORD; int main (void) { // Declarations float mean; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count = 0; int i; // Statements printf("Enter …

Member Avatar for JasonHippy
0
376
Member Avatar for tyler.dahle

Hello, in my game I am wanting to move my character and shoot a projectile simultaneously, but I need the projectile to emit from the character. Thus I am using the same variable for starting positions of character and projectile. When I shoot projectile, it goes from player to wall, …

Member Avatar for tyler.dahle
0
167
Member Avatar for otengkwaku
Member Avatar for freelancelote

Hi, just wondering... is there a site offering some sort of c++ programming mentoring? Something like: make this programme... how would you do it? and then people writing code for it. Would that be a feature for DANIWEB?

Member Avatar for Lynqu2
0
147
Member Avatar for kw42chan

Hi, I have some questions about type check warning. I am reading the tutorial notes from [Click Here](www.clear.rice.edu/comp221/html/pdf/03-arrays-pointers.pdf) CASE 1 int int1 = 1036; /* some data to point to */ int int2 = 8; int *int_ptr1 = &int1; /* get addresses of data */ int *int_ptr2 = &int2; *int_ptr1 …

Member Avatar for owenransen
0
194
Member Avatar for JE821

I'm not sure if I'm freeing the memory correctly. I have the following struct and I'm trying to free the pointer in it. typedef struct RECORD { char* name; int score; }RECORD; In my main function I have an array of this struct, therefore I'm using a loop to free …

Member Avatar for JE821
0
294
Member Avatar for MasterHacker110

I have this code: #include <stdio.h> int create_logfile(char *name, char *field, char *joindate) { FILE *ofile; ofile = fopen("test.txt", "a+"); if(ofile == NULL) return 1; fprintf(ofile, "%s\t%s\t[%s]\n", name, field, joindate); fclose(ofile); return 0; } int main() { char name[100], field[100], joindate[100]; printf("Name: "); fgets(name, sizeof(name), stdin); printf("Field: "); fgets(field, sizeof(field), …

Member Avatar for MasterHacker110
0
219
Member Avatar for Kirielson

Hello everyone, I'm trying to implement qsort on a struct with the double as a pivot: typedef struct{ char sequence[9]; int occurance; double prob; }tuple; ...... int compare (const void *x, const void *y){ if (x < y) return -1; if (x > y) return 1; else return 0; } …

Member Avatar for deceptikon
0
703
Member Avatar for chocolatte.lavista

excuse me, can somebody help me to make a simple program that combine an array,function and pointer.. please... i'm already confuse about C++. please... thank you!

Member Avatar for Schol-R-LEA
0
127
Member Avatar for walas

// i want create doubly linked list in c with following choices: 1- add to head 2-add to mid 3-add to tail 4- delete from head 5-delete from middle 6-delete from tail 7- search 8- print 9- exit i write my program but founded some errors what is it? [CODE]#include<stdio.h> …

Member Avatar for syker111
0
620
Member Avatar for poopoowei

TASK 1 Your first task is to create a Makefile for a project. A project has been provided to you in the compressed file CSCI124-Lab3.zip. In this file you will find numerous headers and source files. You can ignore the fact the program is implemented using classes. The program once …

Member Avatar for NathanOliver
0
227
Member Avatar for sbouxsein

Design a word and character counter and display a histogram of particular characters. The histogram may use any character to denote a single instance of a particular letter, such as an X, and should print the number of instances for that letter at the end of the line. Only print …

Member Avatar for sbouxsein
0
338
Member Avatar for pooh1234qwerty

I cant find the error here... its giving 0 0 as output for all input cases. plz help. #include<stdio.h> #define max(a,b) a>b?a:b void build(int ai,int l,int r); int query(int ai,int l,int r,int i,int j,int count); void update(int ai,int l,int r,int i,int j); int aa,b,m; int inp[6]; struct arr { int …

Member Avatar for Ancient Dragon
0
197
Member Avatar for NguyenHgLong

Dear all, I am studying about Information Technoloy at HCMUS. Through 3 years, I never see that prototype of this function. static void FUNCTION(fft_halfcomplex,pass_4) (const BASE in[], const size_t istride, BASE out[], const size_t ostride, const size_t product, const size_t n, const TYPE(gsl_complex) twiddle1[], const TYPE(gsl_complex) twiddle2[], const TYPE(gsl_complex) twiddle3[]) …

Member Avatar for Moschops
0
119
Member Avatar for coding101

how do you do unbuffered io in c? I need to write each charachter typed to a socket, not waiting for "\n" newline i.e. enter key any help?

Member Avatar for coding101
0
83
Member Avatar for nitin1

i want to do topo sort but i want to output the lexographically smallest topo sort vesion of that. http://www.spoj.com/problems/TOPOSORT/ here goes the link of problem. actually, i have done this using DFS , but i am able to do the question "print any possible topo sort" of the graph. …

Member Avatar for cproger
0
261
Member Avatar for govindh2so4

I have a program like this: int main () { int * buffer1; buffer1 = (int*) malloc (100*sizeof(int)); buffer1 = buffer1 + 5; free (buffer1); return 0; } So my doubt: How much int-sized memory will this free-function free. 100 or 95 ?

Member Avatar for Schol-R-LEA
0
659
Member Avatar for saurabh.mehta.33234

#include<stdio.h> int i=5; main() { int i=6; { int i=7; printf("%d",i); } printf("%d",i); } Why does the above code doesnot give a variable redifinition error..Although the variable i is defined outside of block also??

Member Avatar for Moschops
-1
110
Member Avatar for tyler.dahle

Ok, so I attempted using a struct to animate my character, since my original hard coding produced poor performance. Here is my code: //struct template for animating character movement struct animate { int draws; int animationFrames; char *frames[TOTAL_FRAMES]; int charWidth; int charHeight; int xCoord; int yCoord; int xMove; int yMove; …

Member Avatar for tyler.dahle
0
1K
Member Avatar for MrTang

Our assignment was to write a tic-tac-toe program for my programming class. It is person vs. computer and the computer makes "random" moves, even if computer is going to lose they will choose a random place to put their x or o it is all correct, now what I have …

Member Avatar for Nayana sharma
0
3K
Member Avatar for ashish2expert

I'm having a problem with this code. Can you explain me why this is not working: #include <stdio.h> #include <stdlib.h> typedef struct NODE { int value; struct NODE *next; } Node; int main(void) { Node *root = NULL, *connector; int n; printf("Enter a series of number: "); for(;;) { scanf("%d", …

Member Avatar for deceptikon
0
105
Member Avatar for mksakeesh

why does code 1 gives segfault error whereas code 2 doesn't, both are basically same, do anyone have any suggestion? 1. #include <iostream> using namespace std; template <class T> class nodes { template <class U> friend class linklistchain; private: nodes<T> *adrs; T data; }; template <class T> class linklistchain { …

Member Avatar for mksakeesh
0
275
Member Avatar for Stpdoug

I have a small problem why is this code not writting information into the userdata.txt file? I am not getting any errors in code blocks it runs but the file does not get any data. While in visual c++ the code gives me "debug assertion failed...expression: str(!=NUll)". What am i …

Member Avatar for Stpdoug
0
212
Member Avatar for mical700

C program that extends my.c to take file names as command line arguments. It will read each named file and write the first 10 lines to standard output. If there are no command line arguments, it will read from standard input. If "-" is given as a file name, it …

Member Avatar for mical700
0
148

The End.