19,876 Topics
![]() | |
I'm using a new book this semester for my datastructures class and apart from the bad writing, he has come pretty confusing exercise questions. I do not need code, just to know what he is referring to. [QUOTE]Write a template function count that returns the number of occurrences of value … | |
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 … | |
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, … | |
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", … | |
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 | |
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 … | |
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 … | |
Hey, I found a cool class online for finding certain colors in a designated rectangle around your mouse position. Its optimised for speed, and supposedly works, but when I try compiling it I get around 32 errors. Heres the code [code] public static Point PixelSearch(Rectangle rect, int PixelColor, int Shade_Variation) … | |
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 … | |
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? … | |
[COLOR="Red"][I][/I][/COLOR] hiiiiiiiiiii ds is kiran as a software tester i`m changing my platform to dot net i need ur help how to get a job in Malaysia and pls support me plsss | |
Hi, I am extremly new to C# and whilst I have a basic understanding some of the more complex answers require ample explaining. What i am trying to do is use data stored in an microsoft access database and also write to it from the c# program, i do not … | |
How would I be able to find a certain pixel on any screen under a certain RGB, and then get its x y coordinants? Thank you! | |
<post unlinked from [URL="http://www.daniweb.com/techtalkforums/post35277.html"]this [/URL]original thread> Can you send me your vending machine code? | |
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? | |
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 … | |
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 … | |
Hi everybody, I'm an engineering student. Hee i would like to discuss about some basic and simple C++ interviews questions. I thnk the persons interested in it will participate. Ok can i ask one question? What are the differences between C language and C++ language? | |
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 … | |
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, … | |
![]() | 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 … |
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 … | |
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 … | |
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 … | |
hi, can you help me in making my program ,employee log system program and it is password protected program ^_^ ..... | |
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> … | |
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 … | |
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 … | |
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 … | |
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*/ … | |
[I]<< Forked from [url]http://www.daniweb.com/forums/thread40942.html[/url] >>[/I] [QUOTE=Narue;196586]>But after printing the last word, it just hangs like as if expecting another string too. Probably because it's expecting another string. A newline is whitespace too, and unless you're terminating the loop with Ctrl+Z (or a read error occurs), it'll just keep asking you … | |
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 … | |
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. … | |
hii... :-/ can u plz get me out of the problem..!!!!1 m using visual studio 2005. whenever i click an update button to update values of a particular column of a gridview, all the columns gets updated with the same values. eg. if the 2nd column of 1st row with … | |
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 … | |
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 … | |
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 … | |
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 … | |
Hi there everyone! I've created some functions that decypher the [URL="http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher"]vigenere code[/URL] from a text file, taking care of the frequencies of each letter and all that boring stuff. Now that I have the key, how can I decrypt some words that they (the teachers xD) give me? It'd be … | |
I realize that nobody seems to use Open Watcom's C/C++ compiler but it's the only precompiled C compiler for Windows which compiles code to Linux (I tried building GCC in every way imaginable without success). I've successfully built a few hello world programs without much trouble. However, with a bigger … | |
hello i have to write TCP socket program that mimic SSL handshake protocols. and I do not know where to start my socket programs for Client and Server should be able to communicate with each other. and I want Demonstrate this by sending a packet from Client with the phrase … | |
I wrote a few code to test fork like following: [code]#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <signal.h> #include <errno.h> #include <unistd.h> int DemoFork() { pid_t pid,par_pid; par_pid = getpid(); pid = fork(); switch (pid) { case -1: printf("failure!\n"); break; case 0: printf("I am child!, parent is %d(\n",par_pid); break; default: … | |
this program is supposed to sort an input list and then remove all duplicates. so I'm not quite sure what is wrong with my program, but the output for the original list is a very long list of the same random number(it doesn't change with the input numbers) and the … | |
Hello, I am attempting to create a minfilter, or possibly something else. I will explain the problem and hopefully someone will be able to point me in the right direction. I need something that will intercept requests to a certain harddrive from windows, weather this is through windows explorer, or … | |
int main(int argc, char *argv[]) { int mobile, pond; float a; cout<< "input mobile price:"; cin>>mobile; cout<< "input 1 pound how many BTH:"; cin>>pond; mobile+pond==a cout<<a; | |
Hi, I need an array of approx. 2,00,000 elements.But malloc fails to allocate beyond 65872. When I give (short int*)malloc(sizeof(short int)*65000); It works but seg faults when I give (short int*)malloc(sizeof(short int)*66000); whatsup with that? | |
I have a message Box with two options, Retry or Cancel. Upon clicking cancel, I want to close the MessageBox and then load the main Form. Any idea how to do that? This function is already within a button_click function and I want to get out of this function and … |
The End.