15,550 Topics

Member Avatar for
Member Avatar for Joe Shmoe

I am trying to make a file extraction program in C and I can't get it to work. It compiles ok, but it has a run-time error. I hope you can figure out what I am trying to do here. I don't know if there is a standard way to …

Member Avatar for Joe Shmoe
0
145
Member Avatar for ubi_ct83

hi experts, i have some prob with my code.first,i want to query data from file in string.such as this file "constraint.txt".in this file,i have this: a1,b2,c1, a2,b1,c2, a2,b2,c1, a3,b1,c2, i open th file by using this code: char const_file[100]="constraint.txt"; FILE *in_const[100]; if ((in_const = fopen(const_file, "rt")) == NULL) { fprintf(stderr, …

Member Avatar for ubi_ct83
0
96
Member Avatar for MaestroRage

I'm having some trouble using struct which I can't seem to figure out. it seems to be following all the examples perfectly, i've tried to break it down to it's simplest block and nothing. Can somebody please tell me why this won't compile? [code=C]#include <stdio.h> typedef struct a{ char a[25][12]={"a", …

Member Avatar for MaestroRage
0
133
Member Avatar for ScaryMan

Hi guys. I'm new in this community. I have to do a project which should do this: [QUOTE]Input an integer containing only 0s and 1s (i.e., a “binary

Member Avatar for ScaryMan
0
115
Member Avatar for nateuni

Hi, I am new to programming and I have been doing ok. I have a subject that is in C and I really need to be able to use effectively use pointers. So far my lectures are like snails with replys.. and I have 2 options.. 1. play it safe …

Member Avatar for mrnutty
0
211
Member Avatar for MaestroRage

I'm trying to understand something about 2d char arrays. How can I set up my 2d array to accept the following [code=C] char a[][] = {{"item1", "1", "1"}, {"item2", "1", "2"}}[/code] no matter what values I put in 2 brackets there are too many initializers, and putting a third dimension …

Member Avatar for MaestroRage
0
96
Member Avatar for MrNoob

Hello guys I am reading some book but there and went to input validation but there is something logical i dont get in it you know when press enter with getchar() sometimes it transmits newline to the program but book has solution but i don't know why it works i …

Member Avatar for MrNoob
0
104
Member Avatar for nateuni

Hi, I have looked on boards, googled, I tried you tube had a look at the C books I have on hand.. but I am confused about this... What is the best way to write a struct to a file_ And how is the data saved and then read back? …

Member Avatar for nateuni
0
364
Member Avatar for shell81287

<post unlinked from [URL="http://www.daniweb.com/techtalkforums/post35277.html"]this [/URL]original thread> Can you send me your vending machine code?

Member Avatar for freedert
0
84
Member Avatar for dumbncool

Hi, CAn anyone tell me what does the following statement do in C. [icode]*p++ = val[/icode] My understanding is that because ++ and * have right-associativity, it is equivalent to [code=C] p++; *p=val; [/code] Similarly [icode]val = *--p[/icode] is equivalent to [code=C] p--; val = *p; [/code] Is it correct?

Member Avatar for Aia
0
146
Member Avatar for hket89
Member Avatar for LordoftheFly

Hey guys. Thanks for taking the time to read this post. I'm relatively comfortable with C++ and am taking a class in C for the first time. I'm finding it difficult and frustrating to adapt to the new language. It's kind of like trying to box with a hand tied …

Member Avatar for LordoftheFly
0
163
Member Avatar for invisal

Recently, I have wonder how to execute machine code instruction from memory in C/C++. I am aware of data execution protection. Anyway, I have this piece of code: [code=cplusplus] int main() { // allocate 2 bytes for storing machine code char* mc_add = (char*)malloc(sizeof(char)*2); int reg_eax; // for storing register …

Member Avatar for MosaicFuneral
0
235
Member Avatar for DoEds

I wonder what's the final values of the variables "a, b and c" after this program... It is in pseudocode.... [ICODE]start a = 2 b = 4 c = 10 while c > 6 perform changeBandC() endwhile if a = 2 then perform changeA() endif if c = 10 then …

Member Avatar for Aia
0
112
Member Avatar for Samran

Hi, I ve been working on my assignment. Having problems. Please solve them for me. I will be thankful to you all. What I am doing, or want to do is, read a file in a PROCESS, read it character by character, send each character, one by one through pipe, …

Member Avatar for sathish_s
0
234
Member Avatar for vs49688

hey, I have a program that uses a certain algorithm to decrypt dll files from the game, half-life. but once i have decrypted them, the game crashed whenever i try to start it with the un-encrypted files. How would I reverse the algorithm, making the program encrypt them instead of …

Member Avatar for bughunter2
0
247
Member Avatar for znewsham

Hello, I am trying to create what I thought would be quite a simple file systme filter, based on the following assumption: At some point during a readfile() routine, the filesystem HAS to call a readsector() routine (or equivilent). My intention is, that when this request comes in I redirect …

0
57
Member Avatar for chathu12

Hello every one.I coded a program to print current date and time. First I declare a function tim() to calculate the current time. It works well.But the problem is I cant call the function from main() function.It doesnt print any thing.What is wrong with this code? Please help me.Thanks very …

Member Avatar for yellowSnow
0
101
Member Avatar for anujsharma

Hi, i need to read the system date and time in one file(which is already done).Then in another program i need to read the contents of the first file then check if its has already crossed 1 minute from the current time.i am unable to get how to do it …

Member Avatar for anujsharma
0
123
Member Avatar for tarakant_sethy

Hi i am doing a client server program in c. waht i feel is everytihng is correct in the c code but there is some problem in the setting. here is the server code [CODE] /* Make the necessary includes and set up the variables. */ #include <sys/types.h> #include <sys/socket.h> …

Member Avatar for Salem
0
90
Member Avatar for notsogood

Hi I have a program that adds, deletes, edits and views a text file's contents. The text file, named as "student.cvs" has the following content and format <student code>, <last name>, <first name>, <middle name>: [ICODE]2009-1234, Asa, Gohan, Gogo 2009-4321, Basha, Bushum, Jujog 2009-1999, Mekemi, Mekeke, Makeke[/ICODE] The whole program …

Member Avatar for notsogood
0
106
Member Avatar for nokiolurv

i was jus wondering if u can help me on diz program,, im hav difficulty in findin d mode i hav done everytin jus that d mode iz not coming up. thanx aspa. below is d code i greated so far /* created by Nokiolurv */ #include <stdio.h> #include<stdlib.h> int …

Member Avatar for mrnutty
0
90
Member Avatar for chathu12

Hello every one!Please help me!! I am new to C programming.I wrote a programe to copy lines one by one of a file to an array.But it cant compile.I cant understand the error code also.Please help me! here is my code. #include<stdio.h> int main() { FILE *f; char data[256]={0}; char …

Member Avatar for chathu12
0
5K
Member Avatar for ndfi54

I am writing a program to get a multidimensional array from the user and than find out which of the elements in the array are larger than their "neighbors". Something just isn't working out though and I could use some help. [CODE]/*Library Inclusions*/ #include <stdio.h> #include "genlib.h" #include "simpio.h" /*Constants*/ …

0
72
Member Avatar for revatijadhav

test.c [code] #include<stdio.h> int main() { //System("cat test.c"); exit(0); return(0); } output: #include<stdio.h> int main() { //System("cat test.c"); exit(0); return(0); }[/code] when i compile & run this program in c then i want the same output in java program with it's compilation.. i think i hav to do some change …

Member Avatar for maks91
0
120
Member Avatar for notsogood

I have a program that requires to read from a text file with a .cvs file extension. The program tends to add, edit, delete records written in the file. But before anything, the program simply can't read the .cvs file to begin with. Anyone can guide/help me on this? Thanks. …

Member Avatar for yellowSnow
0
163
Member Avatar for notsogood

My program keeps getting this error: [I]syntax error before "else" [/I] My source code: [CODE=syntax]#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define MAX_STUD_NUM 9 #define MAX_STUD_LASTNAM 20 #define MAX_STUD_FIRSTNAM 20 #define MAX_STUD_MIDNAM 20 #define MAX_INSTRUCT_ID 5 #define MAX_INSTRUCT_NAME 50 #define OK 0 #define CANCEL -2 #define TRUE 1 #define …

Member Avatar for notsogood
0
1K
Member Avatar for mameth

Hi, I'm looking for a plotting library for c that works under windows and unix. And the library must contain only one file(which is the header), so i can move it with my source code. It is required for a chem engineering project for school, i need to plot the …

Member Avatar for mameth
0
117
Member Avatar for MaestroRage

I'm having some issues using itoa I can't seem to figure out. The principle is simple, I am using a 2dimensional char array. For dealing with quantity I use atoi to make it all happy and then I want to use itoa to convert it back into a string because …

Member Avatar for MaestroRage
0
356
Member Avatar for katwalatapan

Hello, I am trying to pass in a long int value and return an array of pointers which is processed in a function that converts long to hex. The array doesn't seem to return from the function. I get an error of the type " type mismatch in redeclaration of …

Member Avatar for katwalatapan
0
133

The End.