18,491 Topics

Member Avatar for
Member Avatar for rceena
Member Avatar for WaltP
-1
1K
Member Avatar for Chris_Giarla

Hello Everyone! This is my first post as a Daniweb member and I am hoping that the people here are as great as they seem. I am a junior in a CS department and I am learning IA32 Assembly as an elective. I am trying to write some basic C …

Member Avatar for Salem
0
216
Member Avatar for ubi_ct83

Hi all, Thanks to all of u for welcoming me as a user in this friendly web. actually im not new,but i never intro myself. Im a student and still learning c.not new learner but new in seriously involve with c. anything that could improve my skill or information about …

Member Avatar for jephthah
0
35
Member Avatar for churni

hi, i have some code which is taking a value of how many moves a function is making to an array of numbers, and displaying it but basically, when i call the function initially, it will give the correct number of moves, when i call it again its adding the …

Member Avatar for churni
0
119
Member Avatar for Freespider

heyy... i need to analyse diffrent text(strings) inputs... and there is no pattern between the inputs... i have a question in my school...i need to do like a little storage with char**...and each time i get a string i need to input it into the char**, if the char** gets …

Member Avatar for abhimanipal
0
120
Member Avatar for Mz3g

Hi guys, I am doing a TCP/IP time server/client. I already wrote the two programs but when I run them I don't get any output. Simply, the idea is the client asks the server for Time or Date and the server has to respond and terminate after the second request. …

Member Avatar for abhimanipal
0
231
Member Avatar for nats01282

I have been told that C++ and C# are very simular, as i am learning C++ and ust downloading XNA which use's C# I just wanted to know if C++ and C# are similar (exept the fact they both begin with the letter C )

Member Avatar for venkat arun
0
180
Member Avatar for balthy

Hey guys, I'm new to programming and C, and I'm trying to write a program for a weighted dice, but I'm awful at math, and I can't figure out how to get it; it took my stupid self long enough to turn rand() into a number between 1 and 6. …

Member Avatar for jephthah
0
2K
Member Avatar for loverdoll

hi? i'm in need of help.. our instructor in computer programming asked us to make a program..mine is a program that will ask the user to input how many sides of polygon she/he wants..minimum of 3 and maximum of 10..and the output should be the polygon with the user's inputted …

Member Avatar for loverdoll
0
121
Member Avatar for ChrisXxX

OK, here's my sample code. The problem is indicated with [PROBLEM] at the starting of the code line. I'm getting a compilation error saying that: 706 C:\Users\user\Desktop\Project.cpp `reg_num' has not been declared 706 C:\Users\user\Desktop\Project.cpp request for member of non-aggregate type before ',' token and its saying this for all my …

Member Avatar for WaltP
0
120
Member Avatar for revenge2

hello there, I am working on a small c program that automatically detects whether the input given is a decimal number or a binary number and coverts accordingly. what is the best way to convert a binary number to a decimal number and a decimal number to a binary number. …

Member Avatar for akirue09
0
553
Member Avatar for matika

[FONT=Lucida Console][COLOR=Blue]is there any function that helps to sort an array of strings alphabeticly i need to sort an array alphabeticly which contains names of students thx 4 yr help matika :cool: [/COLOR][/FONT]

Member Avatar for sachin_mnnit
1
807
Member Avatar for zendet

Hey guys, i need some help with a hangman project for school. The outline is: make program that plays the game of hangman, read the word to be guessed into a string variable. ( The programmer must make about 10-20 words to have one randomly picked each time a game …

Member Avatar for WaltP
0
470
Member Avatar for sam_021

Hi basically i dont have time to do this coursework , due to overload of work .. it probably take like an hour for some1 who knows what they are doing .. ill pay like 15-20 quid ?

Member Avatar for Aia
-3
37
Member Avatar for Freespider

hello... i want to separate string like "!string" i need to put the "string" to some char*... i did char firstWord[10]; sscanf(text,"!%s",firstWord); why its not woking? and how to make it work? i try to search, but nada....

Member Avatar for WaltP
0
147
Member Avatar for elie_kfoury

Hey.. i want to make a string from a text file.. then i want to compare this string with another to see if they are the same... any help?? /*I'm a beginner*/

Member Avatar for elie_kfoury
0
112
Member Avatar for omar isaid

fscanf is a C function designed to read character by character from a file to the system how we can use scanf programmatically to read till first white space ???? :) :)

Member Avatar for omar isaid
1
4K
Member Avatar for aliase

Hi, The problem I'm having is killing a process without knowing it process ID. What I have right now is a client-server communication using FIFOs, the server is running in the background and the client is running in the foreground. What I want to do is when the client quit, …

Member Avatar for Salem
0
101
Member Avatar for abhishekvarmag

Calendar Program [code]#include<conio.h> int day(int m1,int y1) { int d; if(m1==1 || m1==3 || m1==5 || m1==7 || m1==8 || m1==10 || m1==12) d=31; else if(m1==4 || m1==6 || m1==9 || m1==11) d=30; else if((y1%100!=0 && y1%4==0) || y1%400==0) d=29; else d=28; return d; } void main() { long unsigned …

Member Avatar for Aia
-3
796
Member Avatar for anik biswas

hi, I cannot figure out the programme code for the following problem: Write aq programe code for printing all the combinations of the numbers 1,2&3. I would be gratefull if you can help me out with this. Thank you.

Member Avatar for Adak
0
99
Member Avatar for TimCereja

This has been working fine on my system, but refuses to compile on a server that I've uploaded it to. printf("Press <ENTER> to Continue\n\n"); while(getch() != 0x0d); The error message that I get is: undefined reference to 'getch' Any idea how to define getch and get this to compile?

Member Avatar for Ancient Dragon
0
112
Member Avatar for lionaneesh

Hello everyone, Firstly i'll like to introduce myself to the forum. HEy... Ya my need is tat i need a super simple ebook(FREE) on C programming and covering advanced aspects of C like C - linked list , c-graphics and C-BITS... help! /************************************************** **************************************************/

Member Avatar for lionaneesh
-1
116
Member Avatar for Xufyan

I want the remainder of all the numbers inside the loop except the number which i assigned for variable [B]a[/B] for example , if i entered number [B]5[/B] for [B]a[/B], the loop is 5 4 3 2 1. i want my program to take remainder of all these values except …

Member Avatar for Xufyan
0
143
Member Avatar for Iam3R

Hi, Please some one clarify what does the below snippets mean and the compiler assumptions. which one is the correct one to use, what is the problem with others. [CODE] main() { } [/CODE] [CODE] void main() { } [/CODE] [CODE] int main() { } [/CODE] [CODE] int main() { …

Member Avatar for nezachem
0
269
Member Avatar for anjoz

hi i have a program here the 15 puzzle my problem is that im having a hard time makeing a random function the right way and also thinking of a way to make so that the program will not go out of the bounderies here my code [CODE]#include <stdio.h> void …

Member Avatar for anjoz
0
145
Member Avatar for TimCereja

Any idea why this loop repeats regardless of the input? What I have there does correctly assign the proper values to month, day, and year, but the input prompt is repeated no matter what is input. Obviously I would like it to repeat if an impossible day < 1 or …

Member Avatar for TimCereja
0
107
Member Avatar for Egypt Pharaoh

I want the code of program that convert from "decimal to hexadecimal "and from "hexadecimal to decimal " in console applicathion

Member Avatar for NightCrawler03X
0
431
Member Avatar for urzur

Hello, I'm trying to convert a double (3.16) and take its integer part (3). However I'm encountering problems doing this. Can someone pleeease help me out ? Here is my code: [CODE]main: li $v0, 7 #asking the user for a double syscall mov.d $f2, $f0 cvt.s.d $f4, $f2 #converting from …

0
124
Member Avatar for churni

hi, i have a very simple problem with my program and just need a push in the right direction and will be much appreciative of your help. i have a bucket sort program which works fine. well i say fine, its fine when it is sorting the numbers initialised at …

Member Avatar for churni
0
202
Member Avatar for jephthah

i don't recommend atoi() or atol(). this does not handle invalid strings (non-integer strings) very well at all. for instance, if you try [code]value = atoi("CowAndChicken");[/code]the result will be zero (value = 0) and if you try [code]value = atoi("0");[/code]the result will also be zero (value = 0) strtol() avoids …

Member Avatar for Dave Sinkula
0
185
Member Avatar for W4W

Hiii all i hav i little problem i wanna insert a char into an another char and add some other chars .. :D For example : I have the char A = "HE"; i wanna have in B ="HELLO Everybody"; i was doing this in php : [CODE] $string=$A."LLO Everybody";[/CODE] …

Member Avatar for gerard4143
0
86
Member Avatar for gkaykck

[CODE] #include <stdio.h> #include <stdlib.h> int det(int); int minor(int); int main() { int mat[10][10],dim,a,b; printf("Please enter an integer for matrix dimensions(1-10):"); scanf("%d",&dim); for (a=0;a<=dim-1;a++) { for (b=0;b<=dim-1;b++) { mat[a][b]=rand()%10+1; printf(" %d",mat[a][b]); } printf("\n\n"); } printf("Determinant for the matrix is: %d",det(mat)); return 0; } int det(int mat[10][10]) { int a,b,temp,length; length=0; …

Member Avatar for gkaykck
0
169
Member Avatar for urzur

Hello, I'm writing a program in assembly and am encountering a problem. I want to convert a double (floating type number) into an integer (ie. 3.1 into 3). So far, my attempts have been futile. This is my code: [CODE] main: li $v0, 7 #asking the user for a double …

0
66
Member Avatar for TimCereja

How is it that a string, or specifically a part of a string, can be isolated and put into its own integer variable? For example, a user is asked to input a date, such as 12/31/2000, which is saved as a string. How can the "12" the "31" and the …

Member Avatar for TimCereja
0
413
Member Avatar for Mahen
Member Avatar for VernonDozier

Okay, I think I know the problem, but I don't know how to solve it. I want to write a binary file with raw bytes. Windows appears to interpret 10 as ASCII 10 and it does its thing where it interprets 10 as '\n' and decides to change that to …

Member Avatar for VernonDozier
1
155
Member Avatar for jaymeaux77

Hi there! I am working on a simple text based console application for a game of battleship. I am not really looking for a raw code just ideas on where to go next with my code. Some things i would like to put in it that I am flat out …

Member Avatar for jaymeaux77
0
4K
Member Avatar for mirness

please help me.. i dunno how to make my project in C/C++. it's about binary trees but we'll use names instead of numbers or single chars then the traversals.. PLEASE... thanks!

Member Avatar for xavier666
0
63
Member Avatar for retchedmonkey

Hello im working on a C program that counts the number of tabs, blanks and newlines. Here is my code: [CODE] #include <stdio.h> #define MAXLENGTH 500 /* This program accepts a string as input. * It should then count blanks, tabs and newlines. * It should print out the number …

Member Avatar for xavier666
3
463
Member Avatar for bexxy

Ive been trying to figure this out all day but have been unable to make as progress so I was wondering if anyone here could help me out. Im making a program that allows the user to add a name, update the current name list , remove a name from …

Member Avatar for Ancient Dragon
0
106
Member Avatar for bahr_alhalak
Member Avatar for jephthah
-2
130
Member Avatar for macla
0
78
Member Avatar for miraclebos

Hey Narue! I need ur help on a upper-lower case switch problem.. Read the contents of a text file (using ifstream class).. and create a new file or edit the same one (using ofstream class) to switch the case of each char (upper to lower & vice versa).. Thanks a …

Member Avatar for miraclebos
0
189
Member Avatar for Xufyan

Can anyone explain whats wrong with this program why this is not working. [CODE] void main(void) { long a,b=1; clrscr (); printf ("Enter number to calculate its factorial:"); scanf ("%ld",&a); if (a=0,1) printf ("You entered 0 or 1"); else for (a=a;a>0;a--) { b*=a; } printf ("Answer is %ld",b); getch (); …

Member Avatar for Xufyan
0
1K
Member Avatar for mrnobody

Hi, I'm doing a code in MFC to retrieve DateTime from SQL 2005 and then after do datetime manipulation on it. In the SQL table, the date field is 3/16/2010 2:28:20 PM (obtained by using getdate()). I then retrieve the date from RecordSet and stored into _variant_t. To confirm that …

0
76
Member Avatar for dondajr

Hi again. I have a file that have about 1000 lines, and then, time by time I need to read some of this lines, for example: 13:00:00 read lines 01 to 100; 13:30 read lines 101 to 400; .... 15:00:00 read lines 900 to 1000. There is a way to …

Member Avatar for dondajr
0
134
Member Avatar for churni

hi guys, this is my first post to the forum although i do use this website regularly for help. now i have a problem with my code for a sorting program i am making. basically the program is used to make a random number list and then you should be …

Member Avatar for churni
0
243
Member Avatar for johndoe444

I noticed something interesting today. When I run the executable directly it gives no hint where the segmentation fault happened. But if I run it from gdb it gives the line number where the seg fault happened. So I was wondering whether there is any similar utility which I can …

Member Avatar for Salem
0
99
Member Avatar for kxh29

Hello All: I want to create an array of structures like so: [CODE] #define MAX 10 struct hash_tbl { int key; int data; }; struct hash_tbl hash_array[MAX], *ptr; [/CODE] Now, I am having some issues in attempting to "loop" through my array of structures and just generate the some data …

Member Avatar for kxh29
0
270
Member Avatar for vbcielle

how will i round off the return value to decimal place with tis function? [code] unsigned int CalculatePercentage(int TotalComponent, int PartialComponent){ return int((PartialComponent/TotalComponent)100); }[/code]

Member Avatar for WaltP
0
237

The End.