19,876 Topics

Member Avatar for
Member Avatar for XodoX

Ok, I'm wanting to do the following... A C++ program that can edit a sentence with word insertions and deletions. You can assume the sentence has words and numbers separated by spaces and punctuation symbols. The input is a regular text file, where each line is terminated with an end-of-line …

Member Avatar for XodoX
0
116
Member Avatar for ceatkin2

I am trying to demonstrate to my class mates the run time difference in using bit-wise and logical operators. I chose to do this by writing a simple (I thought) program that reads 2 ints from the console, and multiplies them two separate times, one using the logical multiply (a …

Member Avatar for N1GHTS
0
242
Member Avatar for advait_123

Below is the function I copied to get the answer...so plz do tell us the simple method for this..... [CODE]int ** addmatrix(int **a,int x1,int y1,int **b,int x2,int y2) { int i,j,**c; c=(int**)malloc(x1*sizeof(int*)); for(i=0;i<x1;i++) *(c+i)=(int*)malloc(y1*sizeof(int)); if(x1==x2 && y1==y2) for(i=0;i<x1;i++) for(j=0;j<y1;j++) *(*(c+i)+j)=*(*(a+i)+j)+*(*(b+i)+j); return(c); }[/CODE]

Member Avatar for N1GHTS
0
103
Member Avatar for Auraomega

Is there any documentation available on creating a dynamic voltage frequency scaling tool in C? I've been unable to find anything on Google and the only applications I seem to be able to find using DVFS are closed source. My preference would be for a Windows based system as that …

Member Avatar for N1GHTS
0
128
Member Avatar for Supriyo

Hello. Apart from practice and books (like C++ coding standards by Sutter and Alexandrescu) what is the fastest and surest way to acheive coding standards in c++? Supriyo

Member Avatar for xtrmR
0
358
Member Avatar for eman 22

what's the meaning of - abstract data type - heab and stack - preprocessor.

Member Avatar for N1GHTS
-1
103
Member Avatar for Kakashi Hatake

I wanted some information on the return values : 1. Is it always necessary for a return value of [B]main()[/B] to be an integer. 2. What happens if the return value of [B]main()[/B] is not integer. 3. When a return value other than 0 is returned - does it always …

Member Avatar for pro_rocky
0
124
Member Avatar for amala.123

hi guys. i was going through a code where i saw an enum written as: typedef enum { #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name, #include "lwip/memp_std.h" MEMP_MAX } memp_t; # define inside enum. wat does it mean. Also i saw: #if !MEM_USE_POOLS static #endif const u16_t memp_sizes[MEMP_MAX] = { #define LWIP_MEMPOOL(name,num,size,desc) MEMP_ALIGN_SIZE(size), #include …

Member Avatar for amala.123
1
659
Member Avatar for hanvyj

Hi, I have a list of named enums: [CODE=C]typedef enum EGCDevicePneumaticState { EUnknown, ENotPresent, ENotReady, EPressureNotReady, EFlowNotReady, EReadyOn, EReadyOFF, NumberOfEGCDevicePneumaticState, }; typedef enum EGCDeviceReadiness { EUnknown, EReady, EReadForPrep, ENotReady, NumberOfEGCDeviceReadiness, }; typedef enum EGCDeviceRunState { EIdle, EPreRun, ERun, EPostRun, NumberOfEGCDeviceRunState, }; typedef enum EGCDeviceThermalState { EUnknown, ENotPresent, EOff, ENotReady, EReady, …

Member Avatar for hanvyj
0
6K
Member Avatar for unnamed17

Hi there, I am trying to make a piece of code in C that: 1. opens a specified file, 2. Reads the data in the file and include it in MySQL, based on the position of commas, 3. Converts the last two number into binary and then performs some check …

Member Avatar for unnamed17
0
121
Member Avatar for prasanthsagar

I have an array with some integers. i want to remove redudants integers in the array and print the integers without redudancy... can any one give me the code please.....

Member Avatar for N1GHTS
0
313
Member Avatar for badboy11

Hi All, I am coming from C++ world and working on some C# code. Currently working on a class with an ArrayList data member and would like to control which methods/behaviours get exposed to the client of this class. One of the functions in this class takes an index as …

Member Avatar for badboy11
0
172
Member Avatar for mainstreetmark

I'm doing my first C project in, maybe, 15 years, and have gotten stuck. I'm trying to link a 3rd party library into my project. I've installed the headers in ./include/ft and the libs in ./lib/ft Here's my compiler command and associated output: [icode] [root@wayne tele]# g++ -g lib/ft/libmbusmaster.a -lm …

Member Avatar for mainstreetmark
0
305
Member Avatar for challarao

Hi! I have written a function for passing a string into it and finding its length. When I pass a string it prints a correct value. But when I take two strings and passing them individual len(str1),len(str2) after scanning two strings it returns the wrong value. In the first case …

Member Avatar for Banfa
0
112
Member Avatar for bookmark

[CODE]// #include <iostream> using namespace std; #include <cmath> #include <math.h> int main() { float a, b, c, t, s, area; cout << "Enter the lengths of your triangle's sides: "; cin >> a >> b >> c; if(a>b) {t=a; a=b; b=t;}; if(b>c) {t=b; b=c; c=t;}; if(a>b) {t=a; a=b; b=t;}; if((c*c) …

Member Avatar for bookmark
0
222
Member Avatar for puttam77e

Dear Friends, Can any one suggest me, im using Windows 7, i m try to install the Turbo C complier, but it is creating virtual directory, after completion of the creation of directory, it will ask for renameing the root path, How can i rename the root path... (virtual Directory …

Member Avatar for najmul islam
1
407
Member Avatar for asyk

Hi there, I am trying to find the max and min value in a an array of size 100, but the input is stopped when there is a 0 entered, and it too gets added to the array. The code below works good, EXCEPT it's min value is always -2, …

Member Avatar for asyk
0
141
Member Avatar for ceatkin2

I am trying to define a 2D array of 1000 by 1000 ints and then test which transversal method is faster (row major or column major). I have this written [CODE] #include <stdio.h> #include <time.h> int main() { clock_t start, end; double elapsed; start=clock(); int array[1000][1000]; int row, col; for(row=0; …

Member Avatar for ceatkin2
0
171
Member Avatar for gju

hi guys, i am not able to declare the array dynamically in c will you help me out thanks

Member Avatar for abhimanipal
0
126
Member Avatar for ItecKid

*EDIT-I know strtok doesn't actually 'return' a segfault-I realize after submitting topic that is poor wording. Hello, I am having a problem with the C function strtok, as follows: [code=c] void function_name (char * cmd) /* Gathered from another function using readline. Assume 'ls -l' in this example */ { …

Member Avatar for abhimanipal
0
804
Member Avatar for Aditya Hegde

hello........ I m studying MCA 1st year.... I want to do pure C mini projects...... I need a list of Projects on C platform........ So anybody help me please............

Member Avatar for justiceigwe
0
64
Member Avatar for onus

I wrote a small hello world type of character device driver. When I type echo -n "abcdef" > /dev/bond and do a cat /dev/bond then only last "f" of above input abcdef is displayed rest nothing is displayed. I have experimented many things but I am unable to catch the …

Member Avatar for N1GHTS
0
202
Member Avatar for kchyn

Hey guys, I have a question. I'm writing a script in c++ and want to have the script copy a file whose name was previously determined by the script to a output file who's name is determined through functions and procedures within the script. The whole script is looped until …

Member Avatar for nbaztec
0
200
Member Avatar for vineetgoyal
Member Avatar for soniji88
0
118
Member Avatar for mmmm1118

i make a program using C title HOTEL MANAGEMENT in which i want to print out of bill for customer then what is code for that plz... help me

Member Avatar for N1GHTS
-2
98
Member Avatar for mmmm1118

How can i make a data base using C give an example and also give list of software required

Member Avatar for N1GHTS
0
191
Member Avatar for mmiikkee12

Any idea how to implement a FIFO queue of chars in C? It doesn't need to be too fancy, just a fixed size (say 256 chars) and can't use any library functions (this is for a hobby OS kernel I'm writing, and there's not a lot of functions available for …

Member Avatar for kiranxxx
0
2K
Member Avatar for reddishmiles

hi pls gelp me with my assignment.. i supposed to create a cash register program that will calculate customer's payment and change.. here's what i have so far.. [CODE]#include<stdio.h> #include<conio.h> int main(void) { printf("Welcome to Reddish Bar&Cafe"); printf("\n\n\Choose from the items below:"); printf("\n\n\n\Margarita= 25 bucks"); printf("\n\Beer= 10 bucks"); printf("\n\Martini= 35 …

Member Avatar for reddishmiles
0
969
Member Avatar for phummon

Hi everyone, I'm a moderately experienced C coder trying to figure out the [B]execve()[/B] command. Here's the basic problem: My program takes a command from the user, loaded into the string UsrCmd. The string is tokenized and each token is loaded into ParaArray[]. Then ParaArray[] is used as arguments to …

Member Avatar for mitrmkar
0
284
Member Avatar for binary_boy

this is an assignmentin which i have to create a programme which takes in two input arrays which are already sorted and outputs a combined sorted array. this has to be done by multi threading. we have to create a new thread to take the input of the arrays and …

0
55
Member Avatar for varun mca

[B]Hello sir... I want to know that if we can make a function that exactly works as clrscr() if yes then please give me some idea to implement that..I will try that...[/B]

Member Avatar for Adak
0
118
Member Avatar for jrhitokiri

Hello, I have this code that supposedly imitate a DTR for a homework. I've made the preliminary code, but I'm kinda surprised at the output since it's not what I had expected. Here's the code: [CODE] int login() { int id; char* name, log_time; time_t lt; lt = time(NULL); printf("\nPlease …

Member Avatar for jrhitokiri
0
238
Member Avatar for DanHu

I am trying to divide a integer (2's complement) by a power of 2 and then round that number toward zero. I am only allowed to use bitwise operators such as shifts, ~ ^ & | etc. I've came up with 2 expression but they dont seem to work. Can …

Member Avatar for nbaztec
0
206
Member Avatar for cortez716

I've writen a simple calculator code it is pasted below. What do I need to change in order to make it loop using a "while" statement until, the user inputs the letter ("Q" upper or lower), casuing it to exit the program instead of a function such as(/,*,-,+).. please help... …

Member Avatar for VernonDozier
0
126
Member Avatar for harshchandra

This code calculates and the average waiting time of the process given acc to their burst time..It is a famous scheduling algorithm for process scheduling in operating sysytem . After calculating waiting time it also generates the gantt chart for the process given .

Member Avatar for ezkonekgal
-2
2K
Member Avatar for algarmon

I migrated a c application using the cc compiler from AIX version 5 to Solaris 10. First, I compiled my application with cc compiler using Solaris 10. I did not use special compilation options and compiled without error. Then, I run the application and found the first buffer overflow, then …

Member Avatar for N1GHTS
0
206
Member Avatar for gaurav_13191

Hi, I have the code to add elements at the end of the linked list using recursion. [CODE] //Adds an element at end using recursion #include<stdio.h> #include<conio.h> #include<stdlib.h> struct node { int data; struct node *link; }; void addatend(struct node **,int); void display(struct node *); int main() { struct node …

Member Avatar for N1GHTS
0
559
Member Avatar for The physicist

Hi all, bit of a c++ newbie and hoping you might be able to help me with a problem. I'm trying to calculate the elapsed time between two dates using difftime, however I keep getting an elapsed time of 0. Can anyone see where I'm going wrong? Any help greatfully …

Member Avatar for The physicist
0
839
Member Avatar for myk45

Hello. i wanted to generate the following series(pattern). [B]The captain of TITANIC is a mathematics freak. He has recently been given a problem that he is unable to solve. And he has asked your help to solve it. There are n numbers in a given expression. X1 X2 X3 .... …

0
71
Member Avatar for localp

There's a header class called example.h [CODE] #ifndef __Sample_H__ #define __Sample_H__ namespace example { namespace Samples { class AlgorithmSample { public: virtual void release(void) { delete this; } virtual boolean process(void); }; class AlgorithmDesc { public: virtual String getName(void) const { return "some example program"; } }; }; }; #endif …

Member Avatar for Valaraukar
0
137
Member Avatar for Dazaa

Hi, I usually use C++, but I am working with some very old code and need to do it in C. So i understand malloc is used char *p; p = malloc(200); where 200 is the amount of bytes I need. and yes i know I need to use free. …

Member Avatar for sree_ec
0
178
Member Avatar for harikrishna439
Member Avatar for Ancient Dragon
0
86
Member Avatar for danalovesc

those are the maps: [CODE] multimap<SortKey,T> firstMap; multimap<SearchKey,pair<SortKey,T>*> secondMap; template <class T,class SortKey, class SearchKey> bool GarageDataBase<T,SortKey,SearchKey>::Add(T data,SortKey key1, SearchKey key2) { multimap<SortKey,T>::iterator it; it=(firstMap.insert(pair<SortKey,T>(key1,data))); pair<SortKey,T> *mizi=&*it; secondMap.insert(pair<SearchKey,pair<SortKey,T>*>(key2,mizi)); return true; } [/CODE] I am trying to insert a pair into the firstMap and get a pointer to this pair and …

Member Avatar for mike_2000_17
0
1K
Member Avatar for senche

Hi, Can anyone provide some examples or materials explaining ANSI and Non ANSI C Standards? Need some examples for non Ansi C Stanadard. Thanks in advance, regards, senche

Member Avatar for N1GHTS
0
997
Member Avatar for Dewey1040

I'm trying to create a program to add two IEEE 754 floating point numbers, I'm pretty far into the program but I've come to a halt in the bit shift section of the algorithm. I have created a tmp variable to copy the mantissa(0's and 1's inside the char array …

Member Avatar for N1GHTS
0
1K
Member Avatar for mmmm1118
Member Avatar for SamSmiles

I have a programming assignment which I must complete and I need help starting it. We can't talk about code with the professor or the TA so I thought I'd come here to try and ask. Pretty much were going to be given a text file. This text file will …

Member Avatar for Ancient Dragon
0
113
Member Avatar for galmca

i 'm trying to make this program of a prime number in c language but ive not been able to do so,can any 1 of u plz help me out...i want to do 2 things... 1)First,test whether a number is prime or not 2)generate the series of all the prime …

Member Avatar for ramesh thota
0
470
Member Avatar for kamotekid08

Hi i have a problem in programming I need to search a line from a text file by just entering an identifier. Text File: "my Record.text" contents: 101,Carl Cool,500.00 102,Kurt Cobain,400.00 103,Kid Marion,300.00 the console should ask the id number.. ex. ID:101 and give the output: ID:101 Name:Carl Cool Rate:500.00 …

Member Avatar for kamotekid08
0
137
Member Avatar for bflack

Just one question: Is the two dimensional array coordinates in C opposite to what the coordinates used in plotting in the CARTESIAN PLANE??? please answer and thanks

Member Avatar for N1GHTS
-1
4K

The End.