18,491 Topics
HI, can somebody help with this? This is my source code but i was trying to overwrite it, from C to C++. but no way, I'm not good at this. Language doesn't matter. it's slovak. I just need help with syntax. Thanks. [code=c] #include <stdio.h> #include <stdlib.h> #include <stdio.h> #define …
I just wanted to ask what is [INLINECODE]bioskey()[/INLINECODE], what does it do, and how to use it?
Hi! can somebody please tell me how to avoid floating point overflow error? Mine is a very big program that uses double data type. Is there any way in which I can roundoff double numbers to upto certain digit?
Hello friends, I'm trying to write a program to check the status of a process (specified by its process-id), ie, the process is presently running or not. Can you pls give me some idea to solve it? Thanks in advance. Amit
Hi All, I am starting out with learning the basics of C. Once i have learned that i would like to know how to make the programs look visually better. Things like drawing coloured boxes/ windows etc. One of my learning programs is a simple calculator. If i want to …
hello, we use an async. socket for message handling: [code] WSAAsyncSelect(s, g_iohwnd, SOCKET_IO_MESSAGE, (FD_ACCEPT | FD_CONNECT | FD_READ | FD_CLOSE | FD_WRITE)); [/code] socket messages are directly handled in the g_iohwnd window message loop. Everything works fine beside: [code] status = recv( m_clsocket, ([COLOR=#0000FF][COLOR=#0000FF]char[/COLOR][/COLOR] *)(InputData.m_buffer + InputData.m_buffer_size), RECV_SIZE, [COLOR=#800000]0[/COLOR]); [COLOR=#0000FF][COLOR=#0000FF]if[/COLOR][/COLOR](status …
Hi all, I have a project made in C code which generates the position and the velocity of a pendulum. I want to represent it in a graphic while the points are being generated but I don´t knom how I can do it or if it´s possible. I don´t know …
how to turn a user input into a text file for example user inputs 100 and the program creates a text file named 100.txt? I have tried to work it out but it still doesnt work properly. i used [code=c] getc(stdin); char filename[80]; sprintf(filename,"%d.txt", stdin); [/code] and then i also …
I'm at the point of learning how to write to a file. I created these lines as a test. My concern is that it doesn't look right that I have to write the same sentences for displaying it to screen and to put it in file. [code=c] /* * data.c …
ok here is the deal, i am making a role playing game that has a step by step battle system. it was working until i decided to make a new function called gameplaychoice. now whenever i call to the battle function the progam just skips that line and goes to …
How do I make the console window go full screen? right now when you run the program i made it comes up as a small box, but what code would i use to make it go full screen every time a user runs my program?
Hi, just have a question regarding classes/inheritance and a variable. ive been trying to work out the best way to do it, but would like some outside input. ok..here goes: i have a base class Ship. classes will inherit from this class. i also have a class tinyShip (and later …
:) can u pls help me in my project....it i about programming of basketball game using array..?
Can any one please explain the for statement in this code, I understand the initialization of i=2 and the increment of i=i+1, but I dont understand the conditional test of i<(num/2)+1. The program displays all the factors of a number entered by the user. I don't understand why you need …
I started learning C++ as my first language. But some of the OOP stuff gives me trouble. I know C is a widely used language like C++ and has about the same syntax but isn't OOP.I have tried some basic C so i have not got parts that are different …
Hey, I am trying to open a file with a relative pathname: e.g. file=fopen("/files/index.html"); where the files directory is in the same location as the executable. For some reason the executable cannot locate the file. Why? Thanks, Elise [Edit] OK it works without the initial slash in the path name …
im making a program that: -asks a user for their studentID and stores it as a string. -opens questions.txt for reading -prints to screen the question followed by each answer on a seperate line -accepts an answer from user in letter for i.e. a,b,c,d -writes the answer into a file …
i have generated the single sequense 6,4,5 ...Kindly help me further
writing part of a program where user inputs an ID and the program generates a .txt file with the ID name(numerical ID). [code=c] #include <stdio.h> #include <string.h> #include <ctype.h> #define INFILE "config.txt" #define OUTFILE "studentans.ans" #define IDFILE "stdin" int main(int argc, char *argv[]) { FILE *fout; fout = fopen(IDFILE, "w"); …
Quick Question: Is there a way in c to read an entire file into a string or char buffer? Thanks, Elise
I'm 2 months into a vB.net class at my school and starting to grasp an understanding of programming. I would like to begin with C or C++ after my vB.net class is done or close to it. The point of this topic is to ask for any recomendatios you all …
I think one of the reasons authors of books about programming in C make heavily use of the function scanf() is that is readily available and easy to use for the new learner. That's all good and dandy, however when writers of this books get to the more advanced topics, …
The new line numbers inserted when using syntax coloring code tags is causing me problems when copying and pasting code. Here are some examples: [URL]http://www.daniweb.com/techtalkforums/post311344-32.html[/URL] I copy and paste the code to my editor. This is how it looks when it's selected in my browser:[INDENT][IMG]http://img522.imageshack.us/img522/7406/picture1ji6.png[/IMG] [/INDENT]And this is how my …
/*how to swap two variables without using third variable in c*/ /*program to plot sign of angles from 0degree to 180 degree with increment of 10 degree*/
hi, I am using the header file cnaiapi.h. The c files which include it do not compile because await_contact_mutex, cname_mutex, and appname_mutex are undefined. These are defined in the header file as extern HANDLEs. Any ideas? Thanks[COLOR=#808080] [/COLOR]
Hi how to use the MapPoint Control in Visual C ++ 6.0 please any body reply me soon Hafeez
I'm Sean... a Semi Professional Musician and Management Information Technology student (former Computer Science) :confused: hehe!! right now I am on my 3rd year as MIT, and currently working on a SAD project about TPS (on VB/Access) and a Tax processing system on C... i've really searched for a website …
May I impose on you guys again? I'm trying to learn how to write to disk into a file. I think I got that down, however I would like to be able to display to screen the same text is being written to file. What's a way of doing that?. …
this is a program on pay roll.. [code] #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <ctype.h> #define MAX 5 //#define DATAFILE "c211" typedef struct { char ID[6]; char firstname[10] char civilstatus; int dependents; float netpay; float grosspay; float taxwithheld; float sss; } employee; /*---------------------------------*/ char Menu(char choice){ do{ printf("\n<< CS …
Hi Guys, I have written the below code but still need to remove the null terminator at the end of each string but don't know how. I've try strtcpy , srtcncpy but doesn't work. Any ideas would be highly appreaciated. thanks. [code=c] while (!feof(fp)) { fgets(line,LINE_BUF,fp); count++; strcat(string1,line); printf( " …
Relevant header definitions are as: [code] class XMLChain { private: Segment root; std::vector<XMLOpen*> chain; Segment * immediate; std::vector<XMLOpen> openers; [/code] The function in question is: [code] void XMLChain::open(std::string tag) { Segment * last_immediate = immediate; openers.push_back( XMLOpen ( tag ) ); XMLOpen * cast_immediate = &(openers.back()); (*last_immediate).setNext( cast_immediate ); immediate …
Hi! The gems programming Series Can I just start off with Gems programming 9 or do I have to start off with 1 and work my way up?
Hi, does anybody know how check whether the socket (ie file descriptor) is valid in C? I know it is probably possible to do it using either a read or a write command, however, what other ways are there? Thanks.
Hello, I want to know how to implement semaphore without the use of while or any if statement The Problem is Thread A , B , C they all want to output the result at the same time A wants ot print 'A' B wants to print 'B' C wants …
someone please help me on how to run this coding using knoppix linux.. using c language.. i really need help.. i want to know.. what is the output.. this is the coding :- [code] int main() { Pid_t pid; /* fork another process */ pid=fork(); if (pid<0) { /* error …
Is there an api that converts a texual varaible to an OID (which is respresented in dot notation? In net-snmp, there is an api "getnode" which does this conversion. For example, give the api mymib::ronyd.0. and converts this name to .1.0.1.1.5.
hi im still finishing a calculator program. the problem is i am wondering what command to use to break out of multiple loops. my code is [code=c] [COLOR=Gray]#include <stdio.h> #include <ctype.h> #include <math.h> double do0p(char op, float acc, float num) { switch (op) { case '+' : return acc+num; break; …
I have to pass this assignment which calculates the income of workers using pointers and structures.. I'd be very glad if you could help me with this.. uhmm.. could you also please tutor me about this program if you got any answer..?? thanks!!:cheesy:
Hi everybody. In C running in the Unix environment, there are many ways of getting the directory listing. One I know is to use the ftw library (the way I currently implement it), the other is to pipe from the ls, also sometimes you could use dirent.h. I realize that …
im writing a calculator program in c and having some trouble.. basically it needs to have + - / * ^ functions as well as an integer only mode the code so far [code=c] #include <stdio.h> #include <ctype.h> #include <math.h> int main(int argc, char *argv[]) { float acc, num; char …
i want to know abt algorithm to solve 15 puzzle problem
Hello, i am currently working on the Flapjacks problem, The program compiles correctly, only it keeps going into infinity when i input, it keeps asking for more inputs, and its supposed to stop when i input -1. Here is my Code. [code] #include <stdio.h> #define SIZE 30 int isinorder (int …
Hi all, in one of the header file I have declared #define GPSINIT "version no" I need to find where this string is stored in memory location. I tried to test_string1 = &GPSINIT2STRING; LOG_Write(test_string1,sizeof((int*)test_string1)); /*this func writes the result to a new text file*/ Also is it possible to get …
Hello, before I post my question I just wanted to thank those who helped me last time I posted. I was seriously considering dropping my class thinking that I wouldn't be able to do it. However, with my last hw assignment I came here and Niek_e especially pointed out some …
Hi im new here...i am only an high school student, i hav a problem on my this output...im using turbo c, can u help me with ths?? i cant get it...pls help 1. 55555 4444 333 22 1 2. 12345 1234 123 12 1 3. ****5 ***4* **3** *2*** 1**** …
Hi Guys, I need to be able to print something like: [B]Player 2: Enter a word (1-20 char,blank line to quit):[/B] and then right after I have entered the word the output should look like : [B]Player 2: Enter a word (1-20 char,blank line to quit): apple[/B] My printf looks …
Hi, I am a basic learner in C language.Could u please provide me a good link or tutorial or explanation regarding "order of precedence". I have the table of "order of precedence"........but needed some examples. I am always confusing with them. like, *ptr++=something; *++ptr=something i=i++................etc. Thanks & Regards.
I'm having trouble writing a program. I have to determine the name of student who scores the highest marks for each module and the highest in the average score of 5 modules. Hence display them in a table form where 1st column is the modules and the 2nd column is …
can anyone tell me the code how to connect database in C..The databas3 may be either Oracle ,SQL Server Or MS Acess.. plz help me...
The End.