15,552 Topics
| |
#include<stdio.h> #include<conio.h> main() { int num, dep, with, bal; clrscr(); num=1; printf("MENU"); printf("\n\n1. Deposit\n2. Withdraw\n3. Check Balance"); printf("\n\nEnter a number of choice: "); scanf("%d", &num); switch(num) { case 1: printf("\n\n\nEnter an amount to be deposited: "); scanf("%d", &dep); { printf("You have successfully deposited an amount of %d.", dep); } getch(); … | |
Hey all, I've been trying to build a simple c shell for assignment, and im a bit stuck. It doing something different on my laptop to that it does on my pc :S laptop is on mint 7 pc is virtual machine on mint 8. Im using the getcwd to … | |
I have the following function to delete nodes in a doubly linked list at a specified position [CODE]void Delete(struct dnode **ptr,int pos) /*pos refers to position at which element is to be deleted and ptr is the pointer to the first node in the list */ { struct dnode *temp; … | |
[CODE] #include <stdio.h> #include <string.h> typedef struct { char firstName[50]; char lastName[50]; int age; }Person; void ModifyPerson(Person*); int main() { Person person; strcpy(person.firstName, "firstName"); strcpy(person.lastName, "lastName"); ModifyPerson(&person); printf("First Name=%s\nLast Name=%s\n",person.firstName, person.lastName); system("PAUSE"); } void ModifyPerson(Person *p1) { //This doesn't modify the original variable declared in main function Person person = … | |
Given the matrix representing a relation on a finite set, determine whether the relation is reflexive or irreflexive.. Need your help! | |
<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $sql="INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?> This is my code in php..i want it in C..any help? what … | |
Hello. im having a small problem creating a tree. im not sure where im going wrong. Can anyone please help? Thanks. Here is the code: [CODE] #include <stdio.h> #include <stdlib.h> struct tree_el { int val; struct tree_el *right; struct tree_el *left; }; typedef struct tree_el node; void printout(node *tree) { … | |
Hi! I have an array of doubles that I map to a hashmap to keep track of the indices of the elements. I want to be able to sort the array and still keep track of the indices and thats no problem as long as the elements are distinct. But … | |
Is there anything you have to glEnable for glutBitmapCharacter to work? Because when I use that function, nothing shows up on the screen. At the moment this is how I'm trying to draw: [icode]glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'A');[/icode] These are the things I've enabled: [code=c] glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); [/code] | |
Cn anybody give me a program about adding nodes at the end of the list in C? I just need a basis of a program that I will be creating. I also needed its algorithm. Thanks in advance. | |
this is code for encrypting files using c language. //password encryption program for securing password //pws v 1.0 [B][CODE] #include <conio.h> #include <stdlib.h> #include <stdio.h> //create this directory first D:\Sec_pw (OR as per your system drive names) //file will be overwritten at each execution of program so use once //increase … | |
Whats wrong with my code? [CODE=c]#include <stdio.h> main() { char x[10]; printf("Enter [True/False] : "); scanf("%s", x); if(x=="true") printf("Great..\n"); else printf("What's wrong?\n"); } [/CODE] result: [CODE]root@invecta:~# gcc -o result if.c root@invecta:~# ./result Enter [True/False] : true What's wrong? root@invecta:~# [/CODE] | |
heya guys ... kunal here ,,i m a 3rd year B.E student , really in need of a miniproject based on c/c++ .. can any1 plz help ?? | |
Is there anything wrong with my program,or a better implementation of OPTIMAL. Error returned is as below: Error restoring the refrence stresm Error was: invalid urgment [code] #include "pager_OPTIMAL.h" /*#define DEBUG 1*/ /*define this and the next one for maximum debugging info*/ /*#define DEBUG2 1*/ /*difne only this one for … | |
Below is code from an assignment I am working on, the parts in bold are what I have added. What I have to do is add command line argument "-c filename". Basically the code is a hashtable that when -c is used, user will enter a list of words into … | |
Hi, I am new to the world of assembly and am trying to understand the flags and interpretation between an asm file and my cpp code. I basically have an asm function called by cpp file that runs a divide routine and am dereferencing to return parameter value for pointer: … | |
Hello, I'm with difficult in this situation: [CODE] void teste(int *p_int) { printf("&p_int = %li\n", (long int) &p_int); // Line T1 printf("p_int = %li\n", (long int) p_int); // Line T2 p_int = malloc(sizeof(int)); (*p_int) = 123; printf("*p_int = %li\n", (long int) *p_int); // Line T3 } int main(void) { int … | |
hi i am writing a program that reads integers(signed or unsigend) from file. my input file contains these numbers(without brackets) [41 35 -66 -124 -31 108 -42 -82 82 -112 73 -15 -15 -69 -23] and my code is: [CODE]#include <stdlib.h> #include <stdio.h> #include <conio.h> #include <string.h> main() { FILE … | |
Hi, just started using Xcode to code C programs. Im trying to create multiple programs in the same source folder but Im getting an error message. When i select 'File' -> 'New File' -> '.C File' I can create the file fine: it creates the .c program and a header … | |
Hi, I'm trying to find a way to make some kind of monitor in C. I found this but i get : error: config.h: No such file or directory error: glibtop.h: No such file or directory error: glibtop/error.h: No such file or directory error: glibtop/cpu.h: No such file or directory … | |
I am working on a problem (re inventing the wheel for learning) I have a mxn matric (which is my simplified way of saying it is RAM with bytes on it) Some of the locations on this metric is filled with some data and some places are empty. The mxn … | |
I Wanted some good patterns questions that is challenging. Also some logic teasing questions. forums like codechef have questions bit too absurd to understand. It would be really good if someone could provide questions easy to understand yet logically challenging. | |
[CODE=c] /*main.c*/ #include<stdio.h> extern void func(void); main() { extern int i; printf("i in main %d\n",i); printf("Call to func before modifying i in main...\n"); func(); i=66; printf("Call to func after modifying i in main to 66..\n"); func(); getchar(); } /*file1.c*/ char i=65; void func(void) { printf("i in func %c\n",i); } [/CODE] … | |
I made a binary tree but it has some logic problem can some one point [code=c] #include<stdio.h> #include<stdlib.h> struct node { struct node *left, *right; int data, color; } *root; int check = 0; typedef struct node tree; tree *create_node(int); void add_tree(tree *, tree *); void travel_tree(tree *); int main() … | |
1) Write a program to count the number of blank spaces in a given string. 2) Write a program to abbreviate a given string (e.g. if the input is Amar Akbar Anthony, the output will be AAA) | |
break; The break is used to (1)terminate a case in the switch statement. (2)Force an immediate termination of a loop. sample prog. void main() { int a; printf("1. Happy\n"); printf("2. Sad\n"); printf("Enter Your Choice.."); scanf("%d",a); switch(a) { case 1: { printf("You are happy."); break; } case 2: { printf("You are … | |
Hi, I'm new to the community and to C. i have no programing background what so ever but i have been reading books on it. I am trying to use a for loop to print out the folowing ******* (space)******* (space)(space)******* (space)(space)(space) ******* I wrote the program #include <stdio.h> int … | |
Request for following excerpt's explanation. [URL="http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/param_decl.htm"]http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlcpp8l.doc/language/ref/param_decl.htm[/URL] [QUOTE]Except in certain contexts, an unsubscripted array name (for example, region instead of region[4]) represents a pointer whose value is the address of the first element of the array, provided that the array has previously been declared. An array type in the parameter list … | |
Hi, I've just downloaded GNUstep onto my Vista machine, installing the GNUstep MSYS System, GNUstep Core and GNUstep Devel components mentioned on theGNUstep website ([url]http://www.gnustep.org/experience/Windows.html[/url]). I installed into the standard folders but when I try to open the shell for GNUstep the window flashes up and disappears again. I've checked … |
The End.