19,876 Topics

Member Avatar for
Member Avatar for lionaneesh

Hey respected users and developers, I am a newbie to this pool of c... I am just 14 yrs old.. Plz send me free link to plearn pointers in c.. i hav downloaded many books but all of tem are useless.. The language used in the book is so difficult …

Member Avatar for jonsca
0
169
Member Avatar for ROBIN8719

My problem is that..... whenever i try to run a graphics program in c on windows vista,it does not since it is not supporting fullscreen mode. please tell how could i run graphics pro do i need visual c???

Member Avatar for peter_budo
0
138
Member Avatar for konata_89

how do i want to add search funtion by matric value to get the info of the student add this code[ICODE]#include <stdio.h> #define MAX 10 struct studenInfo{ char name[81]; char matric[71]; }; int main() { struct studenInfo library[MAX]; int menu (void); struct studenInfo add(void); void list(struct studenInfo*sp, int size); int …

Member Avatar for Ancient Dragon
0
118
Member Avatar for HBK_100

[code]#include <conio.h> #include <stdio.h> #include <windows.h> void display(void); void menu(void); int main() { char username[9]; int password=0,x=1; display(); do { printf("\n\t\t\tPlease enter your username:"); scanf("%s",username); printf("\n\n\t\t\tPlease enter your password:"); scanf("%d",&password); //problem if (username == 'udental' && password == 1987) menu(); else { printf("\n\n\t\t\t YOU HAVE MADE AN INVALID INPUT"); printf("\n\n\t\t\t …

Member Avatar for jonsca
0
110
Member Avatar for jonsca

Since mid-afternoon the text in the C forum has been showing up centered on the page (thread listings, threads). I'm using Firefox 3.58. I just checked on IE 8 and it looks ok except that the Intel banner ad is in the wrong place. Anyway, just thought I would let …

Member Avatar for jonsca
0
182
Member Avatar for zhane3

Hi, I basically have a Token of type char *token written from a custom tokenizer.C and H file. What i want to do is parse that into individual characters such has if that char *token is {4r$a$} i want a char arr {4, r, $, a, $}, rather than the …

Member Avatar for WaltP
0
129
Member Avatar for rjani1

Dear all, I am working on the code below: [CODE] int cookTime(int time) { int second, minute; for (minute = time; minute > -1; minute--) { for (second = 59; second > -1; second--) { sleep(1); printf ("%i", minute); printf (" : %i\n", second); } } } [/CODE] Now this …

Member Avatar for rjani1
0
1K
Member Avatar for Tango2010

Hi all, Im trying to use a variable as a path in C. For instance, the user enters a directory and this is used with the '*.*' notation attached so the program loops all files in the directory. I've got the PHP part of this code working in a separate …

Member Avatar for Salem
0
209
Member Avatar for roll_in_k

Hi everyone.. Suppose i have a function : [B]void foo(int ind,float **ptr1,float **ptr2[/B]) that allocates memory using malloc .. - double pointers are much more in reality- I want to use this pointers in other functions too, but when i call them(functions) in main() .. memory leak message appears .. …

Member Avatar for roll_in_k
0
350
Member Avatar for erogol

I have coping with radix sort implementation for numbers which have different length, already I have problem about coding Radix sort for integers and now I need to consider different length numbers please help! Also the other problem is I need to get each number that are separated by blank …

Member Avatar for Salem
0
114
Member Avatar for HBK_100

I am trying to read input form the user and then print them to a file but the compiler is giving me some error about invalid pointer at the fprintf statements [code]void addrecord(void) { struct custinfo info; FILE *customer; printf("\n\n\t\t\t PLEASE ENTER THE CUSTOMER INFORMATION BELOW"); printf("\n\n\t\t\t REGSISRTATION NUMBER"); scanf("%d",&info.regis); …

Member Avatar for WaltP
0
118
Member Avatar for prietysharma121

hello everybody, I have one project due on this sunday....please help me with this.....any clues hints would be highly appreciated.....thanks a ton This project will require you to develop three C functions: float nandFloatMul(float a, float b) float nandFloatAdd(float a, float b) float nandFloatSub(float a, float b) Each of the …

Member Avatar for WaltP
-2
143
Member Avatar for Stack Overflow

Greetings, String parsing isn't always an easy task. Especially in cases where you need to split a single string into a great multitude, but also accounting for maximum performance. The following code presented does this task simply. Using precise allocation techniques perform greatly when writing an algorithm to precision.

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

I need to create a christmast tree which takes R value from user then output on console a Christmas tree in which last part height equals R. The tree consists of triangles of heights from 1 to n.The shape must look like (for R=4) [IMG]http://img136.imageshack.us/img136/4862/christ.jpg[/IMG] thanks in advance...

Member Avatar for abhimanipal
0
115
Member Avatar for konata_89

the question is using pointer variable: a)write a program that receives a sorted array of integer.then it will read an integer value and insert that integer value in correct place (using pointer variable) -is it how im write the code right. b)improve the first program code by allowing the program …

Member Avatar for abhimanipal
0
129
Member Avatar for DJPlayer

I'm scanning a file to see if user input matches a word in the txt file.. if it matches.. increase the array size and add the word. This is a 2d array. "max_word_size" is currently just a constant variable. [CODE]void UserMode(char userAnswers[][max_word_size], int *size) { FILE *fid = fopen("dict.txt","r"); char …

Member Avatar for DJPlayer
0
187
Member Avatar for HBK_100

[CODE]int main() { char username[9],username1[9]; char password [5],pass[5]; int y=1,i=0; strcpy(username1,"udental"); strcpy(password,"1987"); display(); do { printf("\n\n\n\n\n\n\t\t\tPlease enter your username:"); scanf("%s",username); printf("\n\n\n\n\n\t\t\tPlease enter your password:"); //problem/probelm while((pass[i]=getch())!='\r') { printf("*"); i++; } if (strcmp(username,username1)==0 && strcmp(password,pass) == 0) { Sleep(1000); system("cls"); break; } else { printf("\n\n\t\t\t YOU HAVE MADE AN INVALID INPUT"); …

Member Avatar for HBK_100
-2
88
Member Avatar for HBK_100

[CODE]#include <conio.h> #include <stdio.h> #include <windows.h> #include <string.h> #include <stdlib.h> void display(void); void menu(void); void dinfo(void); int main() { char username[9],username1[9]; char password [5],pass[5]; int y=1; strcpy(username1,"udental"); strcpy(password,"1987"); display(); do { printf("\n\n\n\n\n\n\t\t\tPlease enter your username:"); scanf("%s",username); //Right here i want to print out **** printf("\n\n\n\n\n\t\t\tPlease enter your password:"); scanf("%s",pass); if …

Member Avatar for Ancient Dragon
-3
854
Member Avatar for miskeen

Hello, I've an external/global array that is used every where in my code.[CODE] // global.h file short is_valid[10];[/CODE] I initialize my array somewhere in the code and I want to check if everything works. When I try to print the values of the array, I get segmentation fault. [CODE] // …

Member Avatar for Dave Sinkula
0
60
Member Avatar for prockaz

Program not running I'm not sure of he problem [code]//Employee.h #ifndef CLASS_H #define CLASS_H class Employee { protected : char *firstName; char *lastName; public: Employee (); Employee ( char, char ); //accessors //retrieve const char *setfirstName (char); const char *setlastName (char); //mutators //return const char *getfirstName (char); const char *getlastName …

Member Avatar for thomas_naveen
0
307
Member Avatar for cyberguy007

Using the example of 10, all the numbers from 1 to 10 are initially in the game. Suppose the user chooses 9; 9 is added to his score. The Tman gets 1 and 3 since these are exact divisors of 9; the Tman’s score is now 1 + 3 = …

Member Avatar for anup375
0
90
Member Avatar for Kombat

So I am trying to take my assignment and make it load an input file instead of having to input each value manually. How would I do that? Also if my program took arguments (p1a, inputfile, outputfile) how would I link that too Thanks

Member Avatar for Ancient Dragon
0
127
Member Avatar for HBK_100

anyone knows how to use clearscreen with dev and how do you put like asterick in place of user input

Member Avatar for Ancient Dragon
0
65
Member Avatar for hwlibra083

I think I'm semi-close to a solution, but it's just not happening for me. I'm having trouble populating my dynamically allocated multidimensional array with data from a text file. Here's what I have: [CODE]#include <stdio.h> #include <stdlib.h> #define MAXLINELEN 18 FILE *getOpen(); int main() { FILE *inFile; // Declares inFile …

Member Avatar for hwlibra083
0
506
Member Avatar for VernonDozier

The code below compiles, runs, and gives correct results. Note, however, the commented out "Experiment" code. I want to be able to call a function which accepts a variable number of parameters, which then calls another function and passes it those parameters. How can I fix the commented-code so that …

Member Avatar for VernonDozier
1
232
Member Avatar for konata_89

//help me i dont know what wrong with list function [code] #include <stdio.h> #define MAX 10 struct book{ char title[81]; char author[71]; char category[31]; }; int main() { struct book library[MAX]; int menu(void); struct book add(void); int list(struct book,int); int choice, count = 0; do { choice = menu(); switch( …

Member Avatar for konata_89
0
129
Member Avatar for vincenzorm117

Okay I've been working with printf for a while on C and I have been trying to use some of the backslash commands such as: \b = backspace \r = moves the cursor to the beginning of the line For some reason they don't seem to work on xCode. 1. …

Member Avatar for nezachem
0
100
Member Avatar for cyberguy007

[CODE]# include <stdio.h> # include <stdlib.h> # include <string.h> # include <conio.h> typedef struct{ int a[99]; }number; const int max = 99; int main () { number array; int j; int count = 0; for ( j= 1; j <=max; j++ ){ count = count +1 ; array.a[j] = count; …

Member Avatar for Dave Sinkula
0
76
Member Avatar for photoyid

[CODE]#include<iostream> using namespace std; class point{ private: double x,y; public: double getX(); double getY(); void set(double c, double d); }; class polygon{ private: string color; public: void setc(string color1){ color = color1; } void print(){ cout<<color; } string getColor(){ return color; } }; class triangle: public polygon{ private: point v1,v2,v3; …

Member Avatar for photoyid
0
171
Member Avatar for frank_hugo_1100

i have a problem with using the parallel port to output signal to control devices or to receive data . i know that winxp restrict access to the port, so i downloaded the inpout32.dll and i put it in the system32 folder then i used the inport ,outport functions but …

Member Avatar for frank_hugo_1100
0
152
Member Avatar for Robyy14

Hey I am pretty new to c++ and algorithmic , so please try explaining me what to do or give me a code for example don't redirect me to a site that already made a library for this because you only wasted your time telling me that. For example i …

Member Avatar for dusktreader
0
147
Member Avatar for its_yogy

[code] // This is My Client TCP program in C++ // Program Name client.cpp #include <winsock2.h> #include <iostream.h> #include <windows.h> #include <iomanip> char szServerIPAddr[ 20 ] = "192.168.5.251" ; // IP address of my Server int nServerPort = 5000 ; // The server port that will be used by clients …

Member Avatar for WaltP
0
303
Member Avatar for tefatany

[code]struct Node { int data; Node* Next; }; void mergelists(Node*&A, Node*&B , Node*&C) { Node *s=A; while(s!=NULL) { s=s->Next; } C=A; A=NULL; B=NULL; [/code] }(i have a missing but i don't know where)

Member Avatar for WaltP
-1
26
Member Avatar for Pugee

[CODE]//Converter //Thursday 25 2010 7:16pm #include <stdio.h> #include <stdlib.h> int main () { int i; char buffer [33]; printf ("Enter a number: "); scanf ("%d",&i); itoa (i,buffer,10); printf ("decimal: %s\n",buffer); itoa (i,buffer,2); printf ("binary: %s\n",buffer); system("pause"); return 0; }[/CODE]

Member Avatar for WaltP
0
108
Member Avatar for krishh

hello sir/mam turbo c still is not opening with dos. now what should i do? plz reply me as possible as soon.

Member Avatar for Salem
-1
86
Member Avatar for smbee

I have written a program for the famous game of life problem. The program is running perfectly for the sequential version. Now I am trying to implement it in parallel with MPI. I am just sending the main function where I am calling two functions. Calculate is updating the array …

Member Avatar for smbee
-1
283
Member Avatar for jamesbraders

Hi, I am currently writing a program that requires me to take values from a text file and store them in an 2d array, I am quite new to c++ programming so I am not sure how to do it. My text file (posvalues.txt) looks like this: 0 0 0 …

Member Avatar for jonsca
0
268
Member Avatar for veronica_0501

I have to count characters, words and lines from a text file. I am able to count characters and lines but not words. This code is error-less, but the output for words always appear 0. Anyone able to help me see what's wrong and provide a way out? And I …

Member Avatar for gerard4143
0
139
Member Avatar for gplkrsna

Hi, Problem: I have two libraries with two different queue implementations. but with same structure name as "queuetype". Now if I include both of the header files in my code, compilation will go for toss saying "error: conflicting types for 'queuetype' " I need to include both the files. How …

Member Avatar for Narue
0
125
Member Avatar for kohkohkoh

can i know how to save a file name based on the user's input for example: Enter your name : Derrick then i save this input to a file .txt named derrick (derrick.txt) how can i do it? i only know how to use the rename() and delete() function...in the …

Member Avatar for DoEds
0
129
Member Avatar for Sobakaa

Hello everybody! I've wrote a very simple echo server, based on a book about LInux socket programming example and it works just fine. My only problem is that i want to use select() function to handle several connections at one time. I've read lots of reference concerning that function and …

Member Avatar for Sobakaa
0
236
Member Avatar for dhanyakumar

Dear sir, I want information about c of c++ I want design the prgm to DISPLAY and SPEAK... The sentences..... when i run the prgm to DISPLAY that sentences and SPEAK that sentences... plz give me....

0
49
Member Avatar for traced

cant understand much this is the code [CODE] { char *tok, *str; str = calloc (50, sizeof(char)); tok = strtok(str1, " "); while(tok) { if(strcmp(tok,str2)!=0) { strcat(str, tok); strcat(str, " "); } tok = strtok(NULL, " "); } strcpy(str1, str); return str; } [/CODE] what is the function of while(tok) …

Member Avatar for Salem
0
85
Member Avatar for spursfan2110

Hey everyone, I have a kind of large problem. I am trying to input something in C, a number between 0 and 50,000, using scanf(). I understand how scanf generally works, and it does for the most part, but for some reason if the number I enter is greater than …

Member Avatar for Dave Sinkula
0
187
Member Avatar for johndoe444

[CODE]typedef struct _node btree_node; struct _node { int* keys; btree_node* children; int count_keys; int is_leaf; btree_node* parent; int position_in_parent; }; [/CODE] I am getting this error: [CODE]error: no match for ‘operator=’ in ‘*(node->_node::children + ((long unsigned int)(((long unsigned int)(i + degree)) * 40ul))) = 0l’ note: candidates are: _node& _node::operator=(const …

Member Avatar for gerard4143
0
248
Member Avatar for royal33

I need to implement Dijikstra's and Floyds algorithm using a linked list !!! can anyone give a code on how to do it !! because i know to implement it using Matrix but am not familiar with the linked list !! please help me on this !!! The rules of …

Member Avatar for abhimanipal
0
90
Member Avatar for Notme

Hi, currently im working on a project for uni but i have no knowledge in C at all basically what im trying to do is remove all * !"£$%^&*()- and double spaces from a text file so far i am able to copy the text file so that im not …

Member Avatar for Dave Sinkula
0
1K
Member Avatar for newcuser

I really want to write this program in c without c++ coding. Please help me convert my code to c only. Here is sample input from a text file: alex busted marries marries test teste tested smile smiled works worked indexed hello kkked holddd smexexed whitespaced and Here is output …

Member Avatar for WaltP
0
171
Member Avatar for EvilNerd

I made a simple program where a user can pick from the menu. My problem is where do i put this code properly inside the fuction of [B]funcFloat[/B] and [B]funcInteger[/B] [CODE]if (myFloat < 0) // this will output if the user entered a negative value { printf ("You entered a …

Member Avatar for EvilNerd
0
93
Member Avatar for Gonbe

Hello Daniweb, I've ran against an issue in my code and i'm not sure why I receive an error. I've managed to reproduce the error with the following code: [CODE="C"] #ifdef _WIN32 #define PERFORMANCE_METING #endif #ifdef PERFORMANCE_METING #include <windows.h> #endif #include <stdio.h> #include <stdlib.h> typedef enum { FALSE, TRUE } …

Member Avatar for Ancient Dragon
0
152

The End.