19,876 Topics

Member Avatar for
Member Avatar for rockerjhr

ok here are the files [B]globals.h[/B] [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( L ) ( ( L ) -> next ) typedef enum { OK, ERROR } status ; typedef enum { FALSE = 0 , TRUE=1 } …

Member Avatar for Adak
0
290
Member Avatar for lianpiau
Member Avatar for f.damati

Hello everyone, I wrote a c program in order to write 5 students records (name, ID and average) to a file. Now the difficult step is to firstly to find the highest average among students. Have anyone any clue how I can do this? Thank you

Member Avatar for WaltP
0
94
Member Avatar for VP2

Memory allocation. Pretty simple, but I guess there might be some people here who do not know what it is... [CODE]#include<stdio.h> #include<iostream.h> int main() { int *n = new int; *n=12; printf("n's value is %d\n",*n); *n=25; printf("n's value is %d\n",*n); delete n; printf("n was deleted\n"); system("PAUSE"); return 0; } [/CODE]

Member Avatar for WaltP
0
460
Member Avatar for efronefron

The problem is I use malloc in the last function(toString()). I just wanna know if there is anyway to free it? or that I dont have to? Thanks [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> /* Function prototypes */ void process(char input); void update(char words[][51], int position); char * toString(char character); /* …

Member Avatar for WaltP
0
214
Member Avatar for anirudhruia

for(j=0;j<3;j++) { repeat:if((int*)ch[j][l]>(int*)ch[j+1][l]) { strcpy(tmp,ch[j]); strcpy(ch[j],ch[j+1]); strcpy(ch[j+1],tmp); } else if((int*)ch[j][l]==(int*)ch[j+1][l]) { l++; } goto repeat; } for(i=0;i<3;i++) { printf("%s",ch[i]); } return 0; NOt gettin any output

Member Avatar for navedalam
0
124
Member Avatar for lochnessmonster

How do i prevent a C string input from the user from exceeding the capacity of the array? is this not possible? [code]int main() { char buffer[8]; printf("enter a string"); scanf(%s,&buffer); return 0; }[/code]

Member Avatar for navedalam
0
75
Member Avatar for ticktoc09

Im a noob in C and I got this simple code working.. [CODE]#include <stdio.h> #include <conio.h> #include <string.h> int main () { char str1[20]="burke",str2[20]; printf("Dog's name?:"); scanf("%s",str2); if (strcasecmp(str1, str2)==0){ printf("Gratz you got it",str2); } else{ printf("Wrong Answer!!!"); } getch(); } [/CODE] My problem is what if instead of "burke" …

Member Avatar for navedalam
0
118
Member Avatar for Dasharnb777

I have 5 strings, such as: "one", "two", "three", "four", and "five". I need to get all permutations of these words. I've explored all internet resources, but all solutions are so bulky and it's hard for me to understand it and integrate it to my program. So, maybe you know …

Member Avatar for Momerath
0
2K
Member Avatar for b56r1

Hi, can anybody help me with this program output. Program is based on GCC compiler standards [CODE=c]#include<stdio.h> main() { int *ptr=10,j; j=ptr+19; printf("ptr=%d\n",ptr); printf("j=%d\n",j); } [/CODE] [CODE=text]output: ptr=10 j=86[/CODE] when ptr value is 10 in statement "j=ptr+19", why the j value is 86??

Member Avatar for gerard4143
0
120
Member Avatar for kayhantolga

I was coding snake game. The game is working normally but I have a little problem.I can't set again commands block.For example The commands are accumulating when I have pressed the buttons,frequency. And note:My language is Turkish. If you want understand variable mean, may be want use googletranslate or boubletranslate.. …

Member Avatar for pseudorandom21
0
168
Member Avatar for negneg

Hi, I have wrote a program to do multiple linear regression (form the matrix ) and solve the relevant matrix using Gaussian Elimination,Unfortunately it is not running and once I get it to run it is gives me the error stating det=0. Please have a look and let me know …

Member Avatar for jonsca
0
202
Member Avatar for Josue198s

hi guys please help writing this shell script in C..please count2:[code] #! /bin/sh # count2 also increments and appends a value to the numbers file # but only when it can successfully create a new hard link to the numbers file count=0 while [ $count -lt 200 ] # still …

Member Avatar for griswolf
-1
228
Member Avatar for VP2

Hello! I've got a little problem... I want to make a program which puts 10 random character, but the characters should NOT be digits. [CODE]#include <ctime> #include <stdio> #include <iostream> using namespace std; int main() { time_t t; time(&t); srand(t); int i,c; char ch; printf("Generating 10 random characters...\n"); for(i=1;i<=10;i++) { …

Member Avatar for WaltP
0
155
Member Avatar for zangetsuu

when i run the program it skips the Int Tax(); function an i tried changing it to void an taking out return 0; but its still not working [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> char vehicle[5]; int car; int truck; int hrsn; //Hour the vehicle entered …

Member Avatar for zangetsuu
0
181
Member Avatar for micmo

Hi Guys, I have two forms (Main and Sub). There will only ever be one instance of Main, but can be many open windows of the Sub form. What I want to do is know which Sub form was the last form to have focus when switching to the Main …

Member Avatar for zachattack05
0
10K
Member Avatar for andylbh

Hi guys, I'm trying to do a client server socket program, where the client writes a list of numbers for the server to compute, and then finally server returns a result. I've managed to get my functions working the way I want (not in client/server) But I've problem implementing it …

Member Avatar for gerard4143
0
2K
Member Avatar for gyuunyuu

I need to read words from a text file, build a structure to store the word and its occurrence. From what I was told from my TA, I need to read words, determine its size (how many chars) and allocate memory for its size. Then I need to build an …

Member Avatar for gyuunyuu
0
172
Member Avatar for TriG0rZ

Hi, Im kinda new to creating C++ gui apps. I am using a application called c++ Builder XE and i was wondering if anyone knew of any good tut for creating a GUI application and any other tut that may help using this application Thank you :)

0
36
Member Avatar for nnejy

Hello, i am trying to figure out what i did wrong. i am trying to add a subtraction flag to my current 32 bit adder, and i keep getting the incorrect output back. For example, if the user enters: input 32 bits: 0 0 0 0 0 0 0 0 …

Member Avatar for nnejy
0
194
Member Avatar for liam0014

Hello, I posted yesterday regarding my issues with adding rows to a database, this is now solved and I am grateful. Once the rows were added to the database the list box that displays one column of the database did not update so I included the following code after the …

Member Avatar for Mitja Bonca
0
5K
Member Avatar for negneg

Can any one help me to run this program? I am trying to modify it for multiple linear regression and use Gaussian elimination to solve the matrix.I found this in a book but it is not working:(Does anyone have anything related?I am a beginner so please something not so complicated …

Member Avatar for Software guy
0
150
Member Avatar for stompjrkz400

ok everyone, i taking my first semester of C++ and i have a little quesiton, the teacher wants up to output and input on the same line, but to send the input through i have to strike enter, which keys to the next line, heres my code, just cant get …

Member Avatar for Labdabeta
0
284
Member Avatar for wingmark

Hi All; Where is the best place to find C++ tut's that are easy enough to follow so that i can start learning C++? Regards Wingmark

Member Avatar for Labdabeta
0
111
Member Avatar for gaurav_13191

Hi all, I have a doubt regarding finding a loop in a linked list.I searched on internet and found 2 different ways of doing the same. But my doubt is that if a linked list has a loop, then wouldn't it be a circular linked list? If yes, then the …

Member Avatar for gaurav_13191
0
92
Member Avatar for liam0014

Hello, I am quite stuck. I have my database running on a seperate machine from where I am writing my application. The connection between Visual Studio and the database seems to be fine as I can display data in various controls on the GUI. My problem arises when I try …

Member Avatar for prvnkmr194
0
528
Member Avatar for sajidtariq

hi every one i want to ask is there any way through which i can retrieve column number of csv file using c programming. those number which are by default set in cvs file also the row name i-e A B C.............. Z AA AB AC........... thanks in advance

Member Avatar for Ancient Dragon
0
179
Member Avatar for cableguy31

I'm trying to write a simple program that takes arguments and concatenates them into a single string. It compiles fine, but when I run it, I get a segmentation fault. Here's the code: [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> main(int argc, char *argv[]) { int i; int strlen; char …

Member Avatar for cableguy31
0
152
Member Avatar for billybobjack

Hello, I'm reading data in from a serial device and I'm having trouble parsing the data into a human readable format. The serial device sends out a 75 byte packet at a rate of 3hz. Using read() I get data from the serial port as it becomes available, and write …

Member Avatar for Software guy
0
783
Member Avatar for Utsav Chokshi

Question:How many main() in one C program is possible? Answer:(a)Exactly one or (b)More than one If answer is b than write easiest program having two main()s...

Member Avatar for nezachem
0
244
Member Avatar for gaurashu

hi.. i wanna make my own library in turbo c. For this problem i have gone through net and i found something that is stated below. plz correct me where i am missing somthing. 1- make 2 file with extention .c and .h i am also confused about that where …

Member Avatar for Adak
0
158
Member Avatar for junrey laao

hi: i need to make a code for the process scheduling like round robin,first come first serve, preemptive and short job first. it should display all average waiting time for each scheduling.. and suggest what type of scheduling should be used... please help me... i need some help here...

Member Avatar for griswolf
0
87
Member Avatar for lianpiau

Hello expert, I had a problem in C# datagridview. I want display last month data or ?days only when form load. I know use SQL query. But the problem is at datetime and string. my idea is today date - 30 days. [CODE]private void OT_Load(object sender, EventArgs e) { ConnectionStringSettings …

Member Avatar for lianpiau
0
1K
Member Avatar for fg_aa_c

Does anyone know of any examples or tutorials for how to create a pthreads server? I have built a web server using fork() which works fine. I want to convert it to multi threading but I really cannot understand how the variables work in respect to mutexing, i don't understand …

Member Avatar for Ancient Dragon
0
110
Member Avatar for Splam Bub

Hello DaniWeb! I'm trying to return an array of strings from a function but I'm not sure how to do so. I've done the prerequisite Googling and have found people on this discussion board recommending to return char** which, it is said, can then be converted back into 2d array …

Member Avatar for Splam Bub
0
157
Member Avatar for vineeshvs
Member Avatar for bergqvistjl

Hi, what would be a easy way of taking chars from the BEGINNING of a string, and placing them in another variable, ensuring that they are removed from the original string, ideally at the same time? basically, say i have 2 strings, string1 and string2. string1 contains "helloworld" string2 is …

Member Avatar for WaltP
0
147
Member Avatar for nadleeh

if i have a list kinda like this "name" bobby "endname" "age" 34 "endage" "name" susie "endname" "age" 53 "endage" how would i sort through it ignoring the stuff in "" and copying just the names and ages into arrays. ive been using strtok and if statements but that doesnt …

Member Avatar for Adak
0
137
Member Avatar for plang007

I need help with this program. I do not know how I would calculate to find out the gallons as well as the cost as pictured in my output. How would you do this? Here is my output: For each student, you will get the gallon of paint Input the …

Member Avatar for Ezzaral
0
243
Member Avatar for thecstudent

Hello World! I am new to C and would like to write a C program to accomplish the following: I have an external 600GB USB disk device, Padlock Pro. The device, which can be seeing at: [url]http://www.amazon.com/Apricorn-Encrypted-Portable-External-A25-PLe256-640/dp/B003EYVJTU/ref=sr_1_1?ie=UTF8&qid=1298479333&sr=8-1[/url] has a number pad on it. It uses a maximum key of 16-digit, …

Member Avatar for thecstudent
0
203
Member Avatar for chound

Is it possible to create programmes to run on coumputers thad do not have any operating systems? :evil: :cheesy: :sad:

Member Avatar for aer9998
2
222
Member Avatar for Protoroll

So I converting a decimal value into hex, but I need to print it out from an array. I'm not sure where to go from here. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> int hexa = 16, deci, quotient, p; void dec2hex(unsigned int x, char hex[]) { for (p = …

Member Avatar for Ancient Dragon
0
125
Member Avatar for sonuja

how to connected data base(sql) with c language......? with exampal...?

Member Avatar for Ancient Dragon
0
131
Member Avatar for salvador01

hi! good day im a newbie and trying to learn functions in C. and im having a problem with functions. int charges (int l, int w) { int c_charg; c_charg = 8.23 * area; } l = 6, w= 3, and area = 18 problem is 'c_charg' is assigned a …

Member Avatar for jonsca
0
91
Member Avatar for vineeshvs

i allocate memory for b_edge in function bark_edge and give value to only b_edge[1][1] and try to return b_edge from function. segmentation fault comes? can you please check why? [CODE]//function bark_edge+main program #include<stdio.h> #include<math.h> #include<stdlib.h> double **bark_edge(); main() { double **b_edge; b_edge=bark_edge(); printf("%f",b_edge[1][1]); } //FUNCTION-bark_edge double **bark_edge() { int i=0; …

Member Avatar for vineeshvs
0
181
Member Avatar for vineeshvs

segmentation fault comes in the program? please help? is there any way i can check in which part of the program is the mistake? Thanks daniweb and members... [ICODE] //function bark_edge+main program #include<stdio.h> #include<math.h> #include<stdlib.h> double **bark_edge(int f_size,int samp_freq); double **transpose(double **x,int M,int N); main() { int f_size=1024; float samp_freq=44100,fcmax=samp_freq/2; …

Member Avatar for vineeshvs
0
409
Member Avatar for devfresher

c# interview questions are generic collection faster. I had a argument with the interviewer and my thought is they are not faster please help.

Member Avatar for khadakbist
0
205
Member Avatar for plang007

After your program works correctly for one student, add a loop so the user can process any number of students. Prompt the user for the number of students to process; use that value to control the loop. *How do I prompt the user for the number of students to process …

Member Avatar for NathanOliver
1
814
Member Avatar for Nurkan

[B]Hello To All Programmer:),,,im a beginner plzz help to make this program.. Make a program of am institution using manual system flow and convert it to computerized system using Turbo C program..:S the institution is Boutuque.. plzz help me...TY programmer,,[/B]

Member Avatar for Adak
-1
105
Member Avatar for axn

How do I read and print just n(10) lines in a file and not whole file. [CODE]#include<stdio.h> #include<string.h> int main() { char line[50]; FILE *datafile; datafile = fopen("/data3", "r"); while(fgets(line,sizeof line,datafile)!=NULL) printf(" %s\n", line); fclose(datafile); return 0; }[/CODE]

Member Avatar for Narue
0
163

The End.