19,876 Topics
![]() | |
hello, I'm writing a program to collect the data from a sonar of a robot. the robot is running Fedora 6. I want to collect the data in an external file as there is a lot of information to be reviewed. the program is fine when I direct the sonar … | |
hey guys. I need some help here! I have a 2D vector named grid. what i need to do is magnify any data in it. it's of a bool type so something like this. 1100 0110 0011 in the 2D vector would become (after magnification) 11110000 11110000 00111100 00111100 00001111 … | |
I am a new guy in C. But I have read stuffs about Malloc, Realloc, how to pass pointers to the function... If I am writing this code in single program, it works perfectly...but smart programmmer guide says write in compact form. So with user defined function this is not … | |
I have the text file (in1.text) <<<start>20>>everything going fine or not<start>i do not know but I am trying<end><start>Trying is but we can do<startabcdefghijklmnopqrstuvwxyz<end> <<<start>20>>Trying to do things<end><<<start>20>>well try try and try again<end> I have to extract tag <<<start>20>> from file.My code is [code=cplusplus] #include <vector> #include <fstream> #include <sstream> #include … | |
HOW to develop a program that plays the game of Mastermind by C programming? The Game of Mastermind Mastermind is a simple code-breaking board game for two players, i.e., a codemaker and a codebreaker, invented in 1970 by Mordecai Meirowitz. The codemaker secretly creates a code consisting of four colors … | |
i am trying to generate random numbers in a loop i wrote this function [code=syntax] int getRand ( int a , int b ) { static int x = 0 ; if ( x == 0 ) { srand ( time( NULL ) ) ; x++ ; } return a+rand()%(b-a+1); … | |
Hi, I'm writing a program where the user can enters numbers and these numbers are stored in a file, then the numbers are read from the file and a certain calculation is done to each number by creating a thread for each My problem is: The first problem is whenever … | |
Hi guys, I'm writing binary data to a file using fwrite. I can't get rid of '0x0D' whenever it writes '0x0A'. I use hex-viewer to check data. For example, if data is '0x01 0xFF 0x0A 0x0E', it writes '0x01 0xFF 0x0D 0x0A 0x0E' Is this because fwrite writes by byte, … | |
Hi... I'm currently doing a ludo game in C, I'm stuck with the pawn positions on the board. How do I manage the position of the pawns of each player, if I have maximum of two players and 4 pawns? Here is my code for the pawn position but it … | |
as we know that memory is very important in embedded systems which one is more effective either to use single linked list or Double linked list..even though DLL is more convenient it will consume more memory.. | |
hai can we write a C program without using main()..if yes what is the other way of doing this | |
Hey Everybody, I'm a MIS Major (Management Info Systems) and am graduating this December with my bachelor's degree. I have a C# project due this Friday by midnight, and so I was hoping to seek out some help before then! Thanks in advance! I hope to stick around for a … | |
Hello everyone; I've got a project at hand that I must pass and I have to admit, I am not good at c++. No excuse, though. I've got all day to get this thing done. Its a project that asks me to; [I]1. Input 2 matrices from 2 files!!!!! | |
as we use \n for next line is there anyway to go back to the previous line if not then, is there anyway i can use the x,y coordinates of the runtime window. all the experts, Please Help...... Thanks. | |
Hi, I'm trying to create this program that does nothing until it's interrupted in the child, if the interrupt occurs then the parent should sent a SIGQUIT, so fare i have been stuck in an infinite loop =/ Any help is appreciated [code] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include … | |
Hello, I need some help with the program below. [code] #include <stdio.h> float get_startingbalance(void); float getCntOfWithdrawls(); float getCntOfDeposits(); float getEachDeposit(); float getEachWithdrawl(); float checkBalance(); float calcAndDisplayBalance(); float displayBankRecord(); void print_withdrawalnumber(int num_withdrawals); void print_depositnumbers(int num_deposits); void print_startingbalance(float start_balance); void print_endbalance(float current_balance); int main() { /* Declare Variables */ int num_withdrawals, num_deposits, … | |
Hi all, I have two asp.net dropdown lists, one for State selection and the other for County. Both have the autopostback set to true. When I try to navigate through the states using the keyboard (arrow keys) it selects the first state and I can't navigate through the rest of … | |
I am working on one-dimensional arrays for class assignment. I don't think I have this right. Can someone check this: The question is: Write the c++ code that will count the number of elements in an array (named number) of base type int. that are equal to a key value … | |
Often in a code snippet, I will see [code] printf("%d %2d %3d", i,i*i,i*i*i); [/code] What does putting the numbers in front do, since it works the same without them? (ie) [code] printf("%d %d %d", i,i*i,i*i*i); [/code] | |
Write a program and fill a queue with random numbers between 0 and 100. The size of the queue is assumed to be 15. After filling the array with random numbers, display the elements in the queue and remove the elements of the queue and store these numbers according to … | |
HI, Following is a program to calculate resistance. Can u please tell me how to make the program loop again using a 'While' statement or is there anyother way to loop the progam. Now my program runs once. Suppose if i enter wrong values, it should not terminate but rather … | |
Is the difference between the execlp execvp calls and execl execv, is that execlp execvp have the advantage of specifying a file name instead of a path name what makes these two functions better to use over execl and execv? | |
I feel really stupid by asking such question I have the following code [code] char choice; while( ( choice = MenuChoice() ) != 'QUIT' ) { PrintMenu(); { switch (choice) { case STRING: case 's': checkInput(strings); break; case QUIT: break: default: break: } } } char MenuChoice(void) { char menuchoice; … | |
I would like to know if you can measure execution time in nanoseconds - I have the following source code, however the time is measured in milliseconds. Help If You May ! [code=c] #include <stdlib.h> #include <stdio.h> #include <windows.h> #define NUM_ITEMS 500000 void quickSort(int numbers[], int array_size); void q_sort(int numbers[], … | |
Hi, I read in data from a file something like this in my main function text text texttext texxttet texet [code] char **array; ifp = fopen (filename.txt , "r");[/code] then I allocated some memory using malloc [code]for(i = 0; i < 3; i++) { array[i] = malloc(50 * sizeof(char)); } … | |
| |
Hi, I have a problem creating one part of the program, Lets say we have a line (from data file): 333 hou 23se 444 bi 4g and the program should change to : house big deleting first number if there is one ,and changing word parts to numbers, and deleting … | |
Added just to help other.... [code=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> void createHashTable(void); void getData(void); void formatting(void); int insertData(int); int collision_OpenHashing(struct hashOpen*& ,int); int generateKey(int); void DispData(void); void DispHash(void); #define dataSize 15 #define empty -1 #define fail 0 #define success 1 struct hashOpen{ int item; struct hashOpen *next; }*head, hashTable[10]; int dataArray[dataSize]; … | |
Basicaly I'm trying to do this [code=C] int create_student(student_data *student){ printf("Nome do aluno:\n"); fgets(student->name,name_limit,stdin); //wtf? printf("Número do aluno\n"); fgets(student->number,name_limit,stdin); printf("Aqui devia estar um nome %s",student->name); return 1; } [/code] Where student is a custom struct, student->name is char array. For some reason it seems to skip the fgets. Replacing with … | |
Hey all, I'm trying to create a directory monitor that will watch a certain directory and print changes made to that directory. I was wondering if there were any C/C++ libraries that provide an abstract class to access the file system on any OS. I would like the program to … | |
I need help with manipulating my computers clock through a c++ program and i have no idea on how to make the program. Does anyone have any idea on how to do this? | |
anyone know code so that i have to insert a username into the program before i can continue doing anything else? | |
Hello I was wondering whether someone could help me with the below I have a variable called: char company[50]; I have a string which contains: "STEPHEN JOHNSON LTD" I want to change the LTD to LIMITED How do i do this? | |
Hello, I am new in c++. Can somebody send me code for class ellipse. I am looking urgently for code. Regards, | |
Hi guys, I'm working on this problem I've been struggling with for a while now. I'm still confused about parameters and I'm getting all these error messages, saying that a lot of my variables are undefined. I'm sorry, I know this probably looks like a mess right now, but if … | |
I am currently using Kubuntu 8.04. Although I do not know any bash, I altered the bash shell (via internet guides) to append history instead of truncating the history file. After editing the shell, the default way to clear the history only clears the interactive history and not the actual … | |
I have been given some C code to compile which is several years old and need to compile it to see exactly what the program does. I know visual basic to an amount but i haven't touched C before. Anyway, how do i go about compiling the C code when … | |
Hello, On many forums I go by Squint. I am in Texas and taking a course in C programming. I am going through an online course and my instructor does not seem to have the time to help me out so here I am. I am attending Thomas Edison State … | |
Hi all, instead of using the web service(soap calls).... I want to write some c# implementation of the wsdl file... any idea how to proceed ?? | |
Hello everyone! This is my first post here, so, hi. ;) So I'm beginning to port (actually, re-write) one of my C games to Python to extend my Python knowledge, using wxPython. Yes, I know of PyGame, but I really want to use wxPython this time. I'm guessing direct pixel … | |
Helo, i want to write open SSL based c,c++ application for client socket in vc++ without using any API of winsock or MFC functionality. can u guide me how do i implement it. I search a lot on google but not getting exactly. Regards, Amit | |
Hello I have little problem with a code. I want to send information about a size on a file and uses “size_t filesize”. I will send this information thru a network called ”controller area Network” and uses the code stat = canWrite(hnd, 1234, size, 8, canMSG_EXT); in order to do … | |
Data types are used to represent numbers and characters used in a program, why do programmers benifit from having such a variety? Also if anyone could help me out with what an unsigned character is used for? thanks for the help | |
I am so incredibly frustrated right now. I have seriously been sitting here for hours trying to figure out how to validate program input using ranges from a text file. My teacher gives us a lecture that is supposed to help, but the lecture doesn't even have a thing to … | |
I'm looking for a bit of advice. We're getting to the point in our game development where I need to start thinking how we're going to integrate scripting into the game engine. I was looking at Lua, but am also interested in what Perl or Python might be able to … | |
Hi.. I'm want to read each record (in 1 line) using fread(), the problem is the record length is arbitrary.. e.g. 1 "Joshua" "Rosenthal" "34 Mellili Ln" "Earlwood" 1 "000113133121" 0.000 2 "Martin" "Serrong" "45 Rosenthal Ccl" "Doveton" 1 "000113133121" 0.000 3 "Jacob" "Leramonth" "59 Dalion Pl" "Belmont" 1 "000113133121" … | |
I´m writing a program to find the divisors of a number, using the modulo function. my problem is, i´m supposed to use an array to "output" the divisors, and the output should stop when an empty cell is reached. I´m not very confident with arrays and don´t really know how … | |
Hi, I am writing a problem that only works when a certain character is entered (either A, B, or C), and if that character is not entered, the program will loop around until A,B , or C is entered. So i tried the following code segment below, but even when … | |
Hi I'm programming under DOS 6.2. I want to switch the polarity of the interrupt source 5 from "high active" to "low active" so an IRQ appears on a negative edge instead of a positive edge (or level, in my case it's edge). Does anybody know how to do this … |
The End.