19,876 Topics

Member Avatar for
Member Avatar for rob_xx17

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 …

Member Avatar for jephthah
0
2K
Member Avatar for dan_e6

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 …

Member Avatar for dan_e6
0
198
Member Avatar for umeshjaviya

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 …

Member Avatar for Prabakar
0
97
Member Avatar for replyfast

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 …

Member Avatar for pcgeek123
0
76
Member Avatar for oceanaut

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 …

Member Avatar for jephthah
0
2K
Member Avatar for emilio

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); …

Member Avatar for emilio
0
106
Member Avatar for wsn

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 …

Member Avatar for Salem
0
108
Member Avatar for apocrypha

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, …

Member Avatar for apocrypha
0
35
Member Avatar for nilesh03

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 …

Member Avatar for Salem
0
249
Member Avatar for venumadhavkk

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..

Member Avatar for Narue
0
203
Member Avatar for venumadhavkk

hai can we write a C program without using main()..if yes what is the other way of doing this

Member Avatar for Salem
0
29
Member Avatar for atn

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 …

Member Avatar for jasimp
0
68
Member Avatar for Kyouya

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!!!!!

Member Avatar for Agni
0
142
Member Avatar for web_master

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.

Member Avatar for jephthah
0
3K
Member Avatar for wsn

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 …

Member Avatar for jephthah
0
104
Member Avatar for Sleepwalker817

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, …

Member Avatar for Salem
0
357
Member Avatar for dacoon

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 …

Member Avatar for ericstenson
0
98
Member Avatar for flower77

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 …

Member Avatar for Ancient Dragon
0
123
Member Avatar for Firestone

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]

Member Avatar for JLChafardet
0
290
Member Avatar for mghx

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 …

Member Avatar for Narue
0
247
Member Avatar for lavicool

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 …

Member Avatar for mishraatul
0
154
Member Avatar for wsn

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?

Member Avatar for wsn
0
104
Member Avatar for Sh13

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; …

Member Avatar for Sh13
0
154
Member Avatar for Platinumempire

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[], …

Member Avatar for Ancient Dragon
0
254
Member Avatar for Sh13

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)); } …

Member Avatar for Sh13
0
101
Member Avatar for Mark515
Member Avatar for Onixtender

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 …

Member Avatar for Onixtender
0
150
Member Avatar for its.romi

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]; …

Member Avatar for rizrash
0
117
Member Avatar for Crushyerbones

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 …

Member Avatar for Dave Sinkula
0
107
Member Avatar for Barefootsanders

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 …

Member Avatar for CubedStooge
0
144
Member Avatar for spuddy1515

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?

Member Avatar for spuddy1515
0
529
Member Avatar for Mark515

anyone know code so that i have to insert a username into the program before i can continue doing anything else?

Member Avatar for Ancient Dragon
0
92
Member Avatar for sjgriffiths

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?

Member Avatar for Narue
0
66
Member Avatar for bamabambhole01

Hello, I am new in c++. Can somebody send me code for class ellipse. I am looking urgently for code. Regards,

Member Avatar for bamabambhole01
0
90
Member Avatar for shellsy

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 …

Member Avatar for shellsy
0
356
Member Avatar for c++noobie

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 …

Member Avatar for c++noobie
0
155
Member Avatar for RedStarlight

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 …

Member Avatar for RedStarlight
0
140
Member Avatar for squint

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 …

Member Avatar for Serunson
0
75
Member Avatar for manojkumar2004

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 ??

Member Avatar for tgreer
0
76
Member Avatar for Foobar69

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 …

Member Avatar for bumsfeld
0
63
Member Avatar for amit_pansuria

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

Member Avatar for amit_pansuria
0
2K
Member Avatar for komany

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 …

Member Avatar for Ancient Dragon
0
166
Member Avatar for Drake

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

Member Avatar for Narue
0
93
Member Avatar for Indianblues

I am trying to learn c++ from past so many days.lots and lots of books are available.I am unable to find a good book which will teach me from basics to advanced concepts. please somebody suggest me good and complete book.

Member Avatar for Salem
0
65
Member Avatar for nelledawg

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 …

Member Avatar for nelledawg
0
103
Member Avatar for PirateTUX

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 …

Member Avatar for hacker9801
0
112
Member Avatar for cheesy_mel

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" …

Member Avatar for cheesy_mel
0
123
Member Avatar for sfak271

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 …

Member Avatar for Ancient Dragon
0
277
Member Avatar for spec80

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 …

Member Avatar for spec80
0
92
Member Avatar for KeeperOfTime

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 …

Member Avatar for KeeperOfTime
0
126

The End.