19,876 Topics

Member Avatar for
Member Avatar for leway

I can't seem to figure out the code you are missing. Any help getting the below code working would be great. [code]#include <stdio.h> #include <stdlib.h> #define SIZE 2 // initially to test kept it to SIZE 2 typedef struct { char firstName[30]; char lastName[30]; char street[35]; char city[20]; char state[3]; …

Member Avatar for abhimanipal
-1
133
Member Avatar for hassall

Have been programming in Turbo C for some time using an XP platform. I have recently bought a new computer also with XP and Turbo C programmes will not run on it. Has XP been modified recently? Is there any solution other than going back to 98? Thanks Cliff

Member Avatar for hassall
0
212
Member Avatar for Moller

this snippet below is my code. It's supposed to be a memory game, but i have some problems making it work, I've made a button_1 that generates 6 random numbers in random order, those 6 numbers are supposed to tell the "p1 - p6" (pictures (2 of each to make …

Member Avatar for Ketsuekiame
0
1K
Member Avatar for tiger188

Hi all, I'm new here , and I’m new in programming , especially c#, but i work very hard. I have some work to do , particularly saying master degree project. Main thing what i have to do is to create some primitives in 3d , using a text file …

Member Avatar for ddanbe
0
598
Member Avatar for Dave Sinkula

Never use the function [inlinecode]gets[/inlinecode]. Why? It is unsafe. Since the maximum string size cannot be specified, it is always susceptible to buffer overflow. This snippet shows one way to do a safe version of [inlinecode]gets[/inlinecode]. It reads characters from the [inlinecode]stdin[/inlinecode] into a string up to the specified size …

Member Avatar for Narue
0
2K
Member Avatar for OzY360

Hi i am doing C programming in netbeans and when i compile and run my program i get a message in the dos console that says i need to use the nodosfilewarning to disable the cygwin warning i am getting. I have attached a screenshot as it is a rather …

Member Avatar for baxilo
0
2K
Member Avatar for camdaddy09

ive seen this in code on different forums but i have no idea what it does, could someone explain this?

Member Avatar for omol
-4
111
Member Avatar for krap_nek

hi guys, I'm trying to implement a basic program which deals with structures and pointers. I have to insert data for various citizens, which is structure that have other structures as fields. in this case my main objective is to create 2 general functions that will get the information for …

Member Avatar for UncleLeroy
0
169
Member Avatar for nshh

Hi, please answer me the following questions. It will be very useful for me...Thanks in advance. c questions: 1. storage classes (auto, register, extern, static) in c with these informations (scope, lifetime, default value and memory location(where it stored in memory)). 2. why should we use static in function prototype …

Member Avatar for UncleLeroy
0
135
Member Avatar for lionaneesh

Sir/Maam, please suggest me some very simple tutorials explaning right from the basics of such functions . I am doing C since 6 months and was looking at a tutorial of BEEJ's guide to network programming.. there at looking at a source code i found these functions and am really …

Member Avatar for UncleLeroy
0
111
Member Avatar for TheCur3

Hello guys. I'm not very good at at programing but i need to do one program which should do this: Write a program with objects which stores student marks of exam. All the information is read. It must be realized: a. I enter all students marks; b. and see whose …

Member Avatar for ccw87
0
274
Member Avatar for rai32

Hello people, i am really sorry to post two new threads in such a short time, but i have a problem that's driving me nuts. I think i know where my program fails, but i don't know the reason why. Let me explain: I am making a chat program. I …

Member Avatar for rai32
0
153
Member Avatar for habib_parisa

Dear All, I am trying to use free function in C to free memory of an array of pointers. It does not work and I get segmentation fault. The code looks like this: [CODE] #include <stdio.h> #include <stdlib.h> int main() { int *make_pointer(int); void read_array(int *array[3]); /****************/ int *array[3] ; …

Member Avatar for jephthah
0
6K
Member Avatar for Eternal49

Ok, I dont really know how to explain what im trying to do. So it might be easier to just look at my code. But basically im getting the following error messages when I try to compile the code, I know what error messages mean, I just dont know how …

Member Avatar for abhimanipal
0
197
Member Avatar for SpyrosMet

hello forum I need help in making a function that randomly chooses between two numbers that I give through the parameters. Please give me a hint or something. Thanks in advance guys.

Member Avatar for Narue
0
533
Member Avatar for Carter12

Hello, I need some advice from some of the more expert programmers on what path should I take further in my learning process. I started with PHP and now I can say I do ok, not an expert of course. I like programming very much and I love PHP, it's …

Member Avatar for omol
0
260
Member Avatar for Xufyan

find the max value in an array ? can anyone tell me whats wrong with this program ? i've just learned what are arrays so don't know much about it, i want to write a program that prints the max value inside an array. i wrote this: [CODE]int main(void) { …

Member Avatar for MageBane
0
248
Member Avatar for ams_chelseafc

I have written the following Code which will convert an integer number to a roman..I have a array list of integer number which I pass through a for loop and the return value is individual converted Roman character.. My Issue is when the converted value is returned from the function …

Member Avatar for jephthah
0
811
Member Avatar for ContactaCall

Hello. I'm currently developing an IVR system under Asterisk through the Asterisk Gateway Interface (AGI), connecting to a Mysql server using the Mysql C API. The server returns a ticket number that I have to say to the client, so I developed a TTS (Text To Speech) algorithm to say …

Member Avatar for saurabhjasuja
1
343
Member Avatar for noobuser

Hi, can anyone help me with this program. the program inputs a string and replace the first char with the second one. [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX 200 int main(void) { char myString[MAX]; char getCh; char setCh; int i = 0; printf("Please enter the string: "); gets(myString); …

Member Avatar for noobuser
0
175
Member Avatar for speedy94519

Hey guys im having trouble writing this code for my function. I have the idea down and a way to solve the problem but im having trouble writing it in C code. Basically im writing a function that runs exactly like the function strcat from the string.h library but we …

Member Avatar for anonymous alias
0
361
Member Avatar for sourabhtripathi

[CODE]#include<stdio.h> #include<conio.h> int main() { int dec,rem,ans=0; printf("Enter the Decimal number\n"); scanf("%d",&dec); while(dec>=2) { rem=dec%2; dec=dec/2; if(rem==0) ans=ans*10; else ans=(ans*10)+1; } printf(" binary number is"); while(ans>0) { rem=ans%10; ans=ans/10; printf("%d",rem); } getch(); return 0; } [/CODE] this code is not working properly for example for 10 it gives 01, should …

Member Avatar for abhimanipal
0
159
Member Avatar for coolguy_003

Hi, I did the stack implementation using arrays and i would like to do it with function pointers but i have no idea. If anyone could help by illustration that would be great as function pointers is pretty difficult for me! Thanks in advance. coolguy

Member Avatar for anonymous alias
0
269
Member Avatar for jimJohnson

I am writing a program and stuck on entering standard deviation. I have looked on previous forum topics and from what I have found this is what I have coded but when I cout my standard deviation I keep getting a 1.#f Can one of you guys take a look …

Member Avatar for VernonDozier
0
2K
Member Avatar for rai32

Hello again guys, this is the code: [code] struct nodo { char *nom_usuario; //*user_name struct sockaddr_in IP; struct nodo *siguiente; //*next }; struct lista { //list struct nodo *primero; //*first struct nodo *ultimo; //*last }; ... ... ... void ordenar(struct lista* maestra); void ordenar(struct lista* maestra){ struct nodo* aux; struct …

Member Avatar for abhimanipal
0
123
Member Avatar for Graphix

Hey everybody, I currently making a program that needs to activated on startup. So after extensive googling I decided to do it the registry way. However, creating a new value or editing an existing value, is not working. Could you explain how to edit and/or create a value in a …

Member Avatar for Graphix
0
275
Member Avatar for clement99

Hi Guys, I need your help here, I'm working on a assignment, and had done up the source code, but I'm getting wrong results: Summarised below: I screenshot the output: [IMG]http://i4.photobucket.com/albums/y101/clement_twk/Output.png[/IMG] I noticed under the output on these 2 lines are wrong: Addition A + B = 100+103i+106j+109k I supposed …

Member Avatar for Banfa
0
176
Member Avatar for boiishuvo

Hello, I am only starting to design a C program that opens a file; [code] #include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { FILE *fp; fp = fopen ("file.txt", "r"); if (fp == NULL) { perror("Can't open the file"); return EXIT_FAILURE; } printf ("%d\n", fp); system("pause"); return EXIT_SUCCESS; } …

Member Avatar for abhimanipal
0
2K
Member Avatar for blahbla

hi i was given an assignment to do i did it but i'm always getting a segmentation fault i found out where i'm getting the problem but i dont understand why i'm getting the problem heres the code: the extra cout's that dont make sense are just to tests to …

Member Avatar for blahbla
0
75
Member Avatar for llemes4011

Hello, I was wondering if anyone knew anything about programming Microcontrollers with C, and if so what controllers are best/have the most room for the least cost/ easy to get the code on. I know nothing about what's needed to get it up and running, or even what to buy! …

Member Avatar for llemes4011
0
117
Member Avatar for iammfa

Hi, This is an exercise I solved it, I want to know, is my solve is the best solve or there is notes, if there is a notes, I'm glade to hear it: [B]The Exercise:[/B] [CODE]Make a program that calculates the sum, mean, minimum, and maximum of a series of …

Member Avatar for chiwawa10
0
165
Member Avatar for lvhvaraprasad

hi i need code for brute force Boolean satisfyability program. plz help me i need it asap thank u

Member Avatar for 0x69
-7
178
Member Avatar for daino

Hi Would anyone know if there is a book explaining all the various C++ Libraries and what features they encapsulate? I'm thinking in terms of, for example: iostream -- then a list of features and functions in iostream etc. Could anyone suggest any books or good reference material for this …

Member Avatar for daino
0
220
Member Avatar for Iam3R

hi, how the below code is generating out put as " -1 < ( unsigned char ) 1 ". i read in many books saying when we do operation with singed and unsigned value always the resultant will be data type that has more width . i understand that -1 …

Member Avatar for Iam3R
0
121
Member Avatar for muthu.job2009

hi guys can any one work out a program for stack in c..for push and pop asap

Member Avatar for MageBane
-2
70
Member Avatar for jsphb9000

I am having trouble compiling this program. If somebody could take a look and see if my code is sound or not i would much appreciate it. I am worried that my logic and commands might be flawed, if someone could help me out I would much appreciate it. I …

Member Avatar for Aia
0
310
Member Avatar for chrisfrmatl

I am writing a program to print filenames in the current directory and print the time stamps next to them. I am loading the names into an array and then passing them to a function to print the stat and filenames. Here is the code. [CODE]#include <stdio.h> /* For printf, …

Member Avatar for Salem
0
411
Member Avatar for thomasekugm

I am trying to get a small piece of a program i am writing to receive a simple math expression, with two int variables and 1 char for the operator, and then i will work it with an if(){}if else statement. I just don't know how to separate the string …

Member Avatar for thomasekugm
0
166
Member Avatar for ShortYute

[B]Modified mostly from dileepkumar235's [URL="http://www.daniweb.com/code/snippet217246.html"]Login functionality in C-language[/URL] [/B] Inspiration from Narue and my previous post ([URL="http://www.daniweb.com/forums/thread249149.html"]Limit buffer Input[/URL] ) This allows you to prevents the user from entering past the array limit (SizeOfArray) if the user enters more the curser will just automatically backspace by 1 for eg (max …

0
206
Member Avatar for johndoe444

[CODE]for (i = 0;i < e;i++) { // take the excuse scanf(" %[^\n]", excuses[i]); excuse_count[i] = 0; while (sscanf(excuses[i], " %[a-zA-z]", word) != EOF) } [/CODE] The input was My dog ate my homework but at the while loop word is getting the word "My" in each loop. In case …

Member Avatar for johndoe444
0
568
Member Avatar for lionaneesh

[B]Introduction[/B] Hey! Guyz.. Welcome to my very short tutorial explaining basic uses of "malloc" function in C language. [NOTE : You need simple understanding about pointers to understand this tutorial] Hey guyz see by reading this tutorial you'll not be a malloc expert .. This tutorial is only for the …

Member Avatar for lionaneesh
-1
402
Member Avatar for rahulr
Member Avatar for jephthah
0
108
Member Avatar for twampdawg

Alright Guys & Gals I have a stupid question. I've been in IT for 7 or 8 years working up to a network administrator. I'm thinking of making a slight change and moving towards programming. I've had little to no experience in programming so far. Basically I'd like to get …

Member Avatar for jephthah
0
141
Member Avatar for ahmedga

How can insert and delete single linked lists to and/or from middle (any where except at the first and at the last?

Member Avatar for jephthah
-5
80
Member Avatar for Eternal49

Ok, Let me start off and say Im new to C. Im writting a subnet calculator, in my main function I am asking the user for a subnet mask and storing it in a char variable. Im then passing the variable to another function called "truncat", where I strip the …

Member Avatar for Eternal49
0
124
Member Avatar for Robert1995

Heya , I was thinking of making a site opener application :). But I had a lots of problems . The next problem is facing this , it just crashes.:( [B]What do I want my program to do ?[/B] I want to assign a nickname for each of my favorite …

Member Avatar for Robert1995
0
206
Member Avatar for VERMUNDr

[CODE] #include <iostream> using namespace std; const int ROWS = 3; const int COLS = 3; //char matrix[3][3]; void showBoard(char[][3]); void pTurn(int&, int&); void checkPlayerWin(bool&, char[][3]); void checkCompWin(char[][3], bool&); void checkForBlock(char[][3], bool& ); char compRandomTurn(); void compWinCheck(); // Main // Main// Main // Main// Main // Main// Main// Main// Main …

Member Avatar for Robert1995
0
181
Member Avatar for free_eagle

Hi everyone ! I am completely new here , so here is a link to C language tutorial I think that'll be usefull for beginners ... [url]http://www.phim.unibe.ch/comp_doc/c_manual/C/master_index.html[/url] ^_^

Member Avatar for lionaneesh
0
82
Member Avatar for bobyx

Joined: 14 Mar 2010 11:05 Posts: 2 Hi.Still I have problem in my program codes.I write a program in mikroC PROV2.50 for my microcontroller(PIC 18F452) but I faced to a problem that related only to C language and compiler give me the following error messages; extern int adcvalmax[8]= {0,0,0,0,0,0,0,0};// 16 …

Member Avatar for 0x69
0
2K
Member Avatar for shaun2106

How can we [B]shift the Origin [/B]from the Top-Left corner to the Center of screen in [TEX]Turbo C Graphics Programming[/TEX]?

Member Avatar for jonsca
0
351

The End.