19,876 Topics

Member Avatar for
Member Avatar for civil1

hi,this is sandy patel. i need simeone's help as soon as possible. i discribe my problem as under: [B]Problem Statement: [/B]This problem requires you to generate a series of random numbers. There are many algorithms that have been developed for this purpose. One scheme generates pseudorandom numbers by performing a …

Member Avatar for Ancient Dragon
0
248
Member Avatar for himanjim

Hi.. I'm trying to write a simple program to include a c file in another one.. TEST1.c #include<stdio.h> #include<conio.h> #include<test.c> void main() { printf("%c" str); getch(); } test.c #include<stdio.h> #include<conio.h> extern char str; void main() { str='A'; } Is somethin like this is possible??? Code didn't run successfully

Member Avatar for himanjim
0
105
Member Avatar for lapan

hi all..can someone help me how to transfer the C programming in Matlab??

0
40
Member Avatar for shmay

This is from my C mid-term study guide so you geniuses should be able to crack it easily: Write a function that will return a random double number. The function takes two parameters (both integers). The first parameter is the maximum whole-number value that number can be (the minimum is …

Member Avatar for Rashakil Fol
0
177
Member Avatar for mailsteam

Can somebody give me the reason why the integer i is not getting incremented. Here is the code: main() { int i=10; i=i++; printf("%d",i); } and the output is 10. Here my doubt is that, i know that i is post incremented. Eventhough i is not incremented at the time …

Member Avatar for deng_cen
0
197
Member Avatar for kemboy

the problem with this is that after it accepts the four (4) integers it stop and dont go on to find the average. IS THERE ANYONE OUT THERE THAT CAN HELP. NUFF RESPECT TO ALL WHO TRY TO HELP. [code=c] //to calculate the average of 4 numbers #include<stdio.h> int get4ints(){//function …

Member Avatar for WaltP
-1
281
Member Avatar for ravenous

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 separates it into two arrays, based on the position of commas, 3. Converts the strings into doubles and then perfoms some manipulation on …

Member Avatar for WaltP
0
1K
Member Avatar for jerryseinfeld

I mean I can change [code] double d; d= atof("99.0"); [/code] this with %.2f to ---- 99.0 to 99.00 but how can I take from user an integer and change it %.2f??? what should I write in atof ???? anyone to understand ??? :)

Member Avatar for thekashyap
0
81
Member Avatar for zacory

I'm trying to make a simple IM program. I created a server and client that connects specifically to my computer using Winsock2.h I tested it and it works from my computer to my server, from my roommates computer to my server, the library computer to my server, but I had …

Member Avatar for zacory
0
90
Member Avatar for vegaseat

Did you know C# has its own scripting language based on Lisp, here is an example ... [code];;; Scripting a 'C#'' GUI with Lsharp, free from [URL="http://www.lsharp.org"]www.lsharp.org[/URL] (reference "System.Windows.Forms") (reference "System.Drawing") (using "System.Drawing") (using "System.Windows.Forms") ;; Create a form (= form (new System.Windows.Forms.Form)) (set_text form "Hello from Lsharp") ;; Create …

0
70
Member Avatar for Sebouh

Hi all. This is my first post here, and i need urgent help with a programming assignment. I am working on an assignment which requires me to build a simple shell. My shell must handle simple commands with arguements and ones with piping and I/O redirection. The problem is i …

Member Avatar for Infarction
0
117
Member Avatar for ck1212

i need ur help to complete this assignment Write a C program which, reads from standard input, replaces all the occurrences of the characters supplied by the 1st command line argument, with the corresponding characters supplied by the 2nd command line argument, and writes the output to a file supplied …

Member Avatar for rowly
0
161
Member Avatar for nick048

Hi In the main I have declared a variable char string[100]; I need to construct this variable with a function and I have written the code: [code]char stringReceived(int sockDesc){ char unsigned c; char tmp[100] = " "; int i=0; int n; do { n = recv(sockDesc, &c, 1, 0); // …

Member Avatar for mariocatch
0
68
Member Avatar for ahad

Hi During writing a code, I need to define dynamic arrays several times, so I wrote the following simple function for defining a double 1D array: [code=c] /*---------------------------------------------------------------------------- Function for Difining 1-D Dynaimcs Arrays for Storing Double Values ------------------------------------------------------------------------------*/ double *allocation_1d_double(int size) { double *array; if ( (array = (double …

Member Avatar for Ancient Dragon
0
127
Member Avatar for tygerberg

Hi I need help finding a gui library for c/c++, I'm tired of using DOS. I also want to get started in network programming. I want to create a server-client program that will enable me to send text over a network or from a mobile phone to a pc. If …

Member Avatar for Ancient Dragon
0
110
Member Avatar for jan1024188
Member Avatar for jan1024188
0
87
Member Avatar for Tauren

[code=c]cout << "\nYou trade your sword for a battle axe."; inventory[0] = "battle axe"; cout << "\nYour items:\n"; for (int i = 0; i < numItems; ++i) cout << inventory[i] << endl; [/code] Uhh well the question is that I really dont get the ++i Why would you use the …

Member Avatar for WaltP
0
132
Member Avatar for sap.hit21

Hi all, I have faced some problem ina coding. What I have to do is just to replace all "big" with "small" from the string " The world is big. there are big cities. Bigger city mean bigger population. Towns are getting smaller". My code is [code=c] #include<stdlib.h> #include<stdio.h> #include<string.h> …

Member Avatar for sap.hit21
0
94
Member Avatar for pc0019

Hi I've just picked up a copy of SAMS teach yourself C in 21 days (I dont think Ill finish it that quickly) because I wanted to get into programming. I've worked through the first chapter, but keep enountering a problem: my programs exit before I can see what they …

Member Avatar for pc0019
0
132
Member Avatar for arfmal

Can somebody tell/show the example to me on how to declare struct in the class and to use this struct in object oriented environment effectively.

Member Avatar for iamthwee
0
72
Member Avatar for rowly

hey guyz, i'm trying to search each ar for matching characters in the buff, but I seem to be getting a buffer overflow. Can anyone give me any pointers, any help would be appreciated, this is my code: [code] #include <stdio.h> #include<stdlib.h> #include <unistd.h> #include <fcntl.h> #include <string.h> main(int ab, …

Member Avatar for Ancient Dragon
0
168
Member Avatar for mrjoli021

I have a csv file that I need to be able to read it into a struct array. I have read examples and they all match what I have. [code] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] ReadStudents ()[/COLOR] { fstream infile; [COLOR=#0000ff]int[/COLOR] i; infile.open ("c:\\students.txt"); [COLOR=#0000ff]for[/COLOR] (i =0; i < 20; i++) { infile >> …

Member Avatar for mrjoli021
0
92
Member Avatar for nick048

Hi to all, In my little server program, I have this code: [code]i=0; charRecv = recv(nSocketDesc, &c, 1, 0); while (c !='\n') { mystring[i++]=c; charRecv = recv(nSocketDesc, &c, 1, 0); } // End while (c !='\n') mystring[i]='\0';[/code] 'c' are a sequence of char sended to server from a client and …

Member Avatar for Ancient Dragon
0
80
Member Avatar for kjpwa

Ok, so I know lots of people have posted about how to find prime numbers up to a certain number, and I can do that, however If I wanted to output a certain number of prime numbers so that the user inputs say 6, it would out put 2, 3, …

Member Avatar for ANUJ SHROTRIYA
0
827
Member Avatar for student86

I need help verifing. If you need more information let me know, but I am a beginner. Just need help with the verifyValue.cpp what kind of code or functions would you suggest. Thanks [COLOR=#000000]In options 1 and 2, the user will input the ID, Type, Description, Quantity on Hand, and …

Member Avatar for vijayan121
0
92
Member Avatar for viraltaj

Hello friends, This is my first post on this forum. I just came here to learn a bi t of C++. I have developed an operating system called TAJ in C++. Its an object oriented operating system. It is multitasking, multithreading and multiuser operating system. This is its link: <snipped …

Member Avatar for jan1024188
0
160
Member Avatar for rowly

[COLOR=#000000]Hey guyz, I'm stuck with this given, its bit hard I cant understand it just wonna know the logic ( no codes).[/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000]Its saying write a C program which read from standard input, replaces all the occurrences of the characters by the first command line argument, with the …

Member Avatar for rowly
0
149
Member Avatar for mcklein_tunde
Member Avatar for sowmya nair

the problem is as follows: write a program:the array of integers indicating the marks of the students is given.u have to calculate the percentile of the student according to this rule:the percentile of a student is the % of number of student having marks less than him.for example: student marks …

Member Avatar for jimmymerchant
0
137
Member Avatar for ajaxjinx

Hey, Is there any equivalent of conio.h for Linux??? I basically want getche to work in linux.. Is there any alternate??

Member Avatar for ajaxjinx
0
146
Member Avatar for ssthrissur

[COLOR=#000000]C program to create a calculator. The program will accept an arithmetic expression (assumed to be valid expression of only +, -, *, /, 1/x, and % operations) from the user. Evaluate the expression and display the results. Including the above functions, this calculate should provide the temporary buffer (memory …

Member Avatar for WaltP
0
109
Member Avatar for ab3ad

hi i'm student in university i try to do my homework to simulate FCFS and RR i need ur help to tell me if my answer good or :sad: Qustion is: the project is to write a program to simulate FCFS and RR without having any i/o, all processes have …

Member Avatar for Salem
0
139
Member Avatar for maverick786

I am attempting to search a list to check whether an item is already present before inserting. I am having trouble with the pointers; I understand that I need to set the pointer to the start of list but I keep getting compilation errors. Can anyone help? Here is my …

Member Avatar for Lerner
0
79
Member Avatar for aaisha

i've been given an assignment to writet he coding for a calculator. more the functions,higher the score in the assignment! i'll use the switch statement nd read through math.h. wat other suggestions can u guys giv me??there isnt' any limit to the no. of inputs we can take! can ny1 …

Member Avatar for Aia
0
100
Member Avatar for i m gr8

Hello, I am university student and currently we are being thaught C++ and are studying Object Oriented Programming. Since last few weeks what ever assignment I get , My program always end up with thread stop error while runtime and I cant find the reason. I have to currently submit …

Member Avatar for iamthwee
0
484
Member Avatar for techie82

Hello all I'm a fresher to Microcontroller programming. I have defined certain global variables that I need to store at consecutive memory locations, say starting from 0x8000h . Will appreciate if anyone can give me the syntax / instructions to go about the same. thanks techie

Member Avatar for Infarction
0
115
Member Avatar for best

i tried writing a program whose output would display the letter p in a (3 by 12) that is 3 rows and 12 columns, didnot succeed. could you help me

Member Avatar for Aia
0
86
Member Avatar for LieAfterLie

For some reason, newline characters seem to be using 2 bytes in text files instead of one. Is this normal? When I open a text file and look at the size, I get one more for every character I add, except for newlines, which add 2 bytes.

Member Avatar for John A
0
119
Member Avatar for addicted

:rolleyes: I need some one to define prime numbers for me A full definition, I am trying to write a program to determine wether a number is prime, print all prime numbers in a specific range ... e.t.c so i need a full definition of prime numbers, i know prime …

Member Avatar for Lardmeister
0
87
Member Avatar for hbk619

I've posted my C code below for a card game (yep, i'm still on it). Now the neg() function is called from the turn() function. so using return; sends it back there, but i want it to go back to the start of the main function (basicaly start again). As …

Member Avatar for iamthwee
1
2K
Member Avatar for emr

hi i am a new member of daniweb and i have problem i wrote a program in c that finds the numbers which are like that abc...=pow(a,3)+pow(b,3)+pow(c,3)... there are 5 number like that these are 1,153,370,371,407 but my program doesnt show 371 please look this [code=c] #include<stdio.h> #include<math.h> int main …

Member Avatar for Aia
0
194
Member Avatar for LieAfterLie

I'm making a program that compresses text files using the LZW compression algorithm and creates a seperate compressed file. I made a file type and extension and icon for this file type (.nct), and set up 2 actions for it - one that calls the program and passes the .nct …

Member Avatar for vijayan121
0
122
Member Avatar for Manzar

Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number. Hints: Enter the value up to which you want to print the series : 5 0 1 1 2 3 5

Member Avatar for Aia
0
68
Member Avatar for muadh jamal

:confused: please some1 can help me in writing a random number generator funtion......generates number from 1-10000...explain it..plz

Member Avatar for WaltP
0
3K
Member Avatar for RisTar

Well im trying to find a string in a textfile but i have some problems : When im trying to create a string called temp in the Compare function using the length of the string that was typed in to main to compiler gives me an error , and even …

Member Avatar for WaltP
0
115
Member Avatar for Senel

I have started to solve them but no use, im a beginner :o with easy solution please,i will be greatful.. I hope that im didn't ask to much. Q1)Write a program that read two integer and determined and prints if the first is a multiple of the second? {Hint: Use …

Member Avatar for Aia
0
1K
Member Avatar for maverick786

I would like to write a program that creates a relational database that handles queries using only C++. What would be the most appropriate method? Using arrays, linked lists or something else? Please advise.

Member Avatar for maverick786
0
214
Member Avatar for gamodg
Member Avatar for iamthwee
0
67
Member Avatar for lotsofsloths

OK, i am using Microsoft Visual C++ 2005 Express Edition, and am using the Window Applications part of it (compared to using Command Prompt to display programs) Now, as for the program, i am making a password machine that tells users to enter a username and password, my program will …

Member Avatar for lotsofsloths
0
132
Member Avatar for RisTar

Im trying to read some integers values from a text file. The problem is that first lines of the text files contains some text and only then theres the values that i want to read into variables , and i dont know how to get down three lines and then …

Member Avatar for RisTar
0
142

The End.