19,876 Topics
![]() | |
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> … | |
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 { … | |
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 … | |
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 … | |
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 "); … | |
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 … | |
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 | |
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, | |
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 | |
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 … | |
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 … | |
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 … | |
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, … | |
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[]) { … | |
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 … | |
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 … | |
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 … | |
#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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
#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; … | |
#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 … | |
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, … | |
what is the meaning of `fseek(file, -4, SEEK_CUR);` | |
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? | |
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 … | |
![]() | 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 … ![]() |
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), … | |
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; } … | |
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! | |
// 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> … | |
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 … | |
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 … | |
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 … | |
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[]) … | |
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? | |
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. … | |
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 ? | |
#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?? | |
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; … | |
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 … | |
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", … | |
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 { … | |
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 … | |
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 … |
The End.