15,550 Topics

Member Avatar for
Member Avatar for gaurav_13191

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

Member Avatar for prvnkmr194
0
1K
Member Avatar for jay1648

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

Member Avatar for N1GHTS
0
2K
Member Avatar for bflack

Given the matrix representing a relation on a finite set, determine whether the relation is reflexive or irreflexive.. Need your help!

Member Avatar for bflack
0
487
Member Avatar for unnamed17

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

Member Avatar for N1GHTS
0
143
Member Avatar for unnamed17
Member Avatar for myk45

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) { …

Member Avatar for myk45
0
83
Member Avatar for Slimmy

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 …

Member Avatar for Slimmy
0
123
Member Avatar for tomtetlaw

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]

Member Avatar for N1GHTS
0
1K
Member Avatar for bflack

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.

Member Avatar for N1GHTS
0
244
Member Avatar for pro_rocky

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 …

Member Avatar for pro_rocky
0
285
Member Avatar for Invecta

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]

Member Avatar for justiceigwe
0
85
Member Avatar for kunal2020

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

Member Avatar for AndreRet
-1
56
Member Avatar for gnwillix88

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 …

0
40
Member Avatar for freda173

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 …

Member Avatar for freda173
0
156
Member Avatar for piso_mojado

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

0
100
Member Avatar for ricardo.crudo

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 …

Member Avatar for ricardo.crudo
0
94
Member Avatar for Agent-of-Chaos

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 …

Member Avatar for gerard4143
0
171
Member Avatar for Katana24

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 …

Member Avatar for creeps
0
215
Member Avatar for Vagelis44

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 …

Member Avatar for harshil_shah007
0
542
Member Avatar for onus

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 …

Member Avatar for Banfa
0
142
Member Avatar for Rahul.menon

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.

Member Avatar for gaurav_13191
0
92
Member Avatar for swapnaoe

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

Member Avatar for Ancient Dragon
0
190
Member Avatar for onus

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() …

Member Avatar for onus
0
240
Member Avatar for abhiab1991

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)

Member Avatar for abhiab1991
1
131
Member Avatar for Snader

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 …

Member Avatar for N1GHTS
0
128
Member Avatar for hoganmadman

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 …

Member Avatar for N1GHTS
0
92
Member Avatar for swapnaoe

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 …

Member Avatar for swapnaoe
0
169
Member Avatar for hericles

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 …

Member Avatar for N1GHTS
0
116
Member Avatar for unnamed17

Hey i have a filename in this format RECORDddmmyyyy on my PC. I want to include it into mysql table.I solve the problem of getting date but still have one issue,how to pass it to the database. char filename ="RECORD" i append later on the date to it as well …

Member Avatar for N1GHTS
0
146
Member Avatar for smize33

Hi, im new in IT programming, our professor asks me to create or find a program that is capable of showing how a bubble sort works.. this is the program.. [Code] /********************************************* * Demonstration program of Bubble sorting * * (about n*n comparisons used). * * ------------------------------------------ * * Reference: …

Member Avatar for N1GHTS
-2
184

The End.