19,876 Topics

Member Avatar for
Member Avatar for jeyson

a program that will ask a location and selete the item in that location[code][/code]

-3
61
Member Avatar for banders7

Code written and tested using the Borland C++ compiler. Code uses access() to determine if an input string exists either as a directory name or as a file name. If access() fails, the string is neither a file or directory and the function terminates. If it does exist, the name …

0
210
Member Avatar for sparksterz

Ok this is driving me nuts. I'm working in C++ and trying to delete an element from a vector It's going something like this (dirPath is a stack of directories, and dirPtrs the list of what a directory points to) [CODE] for(int i = 0; i < dirPath.top().dirPtrs.capacity(); i++) { …

Member Avatar for sparksterz
0
367
Member Avatar for needhelpe

HEY I JUST NEED TO PUT THE FOLLOWING: IF((N == 2) && (T CAN'T BE DIVIDED BY 4)) how can I put: CAN'T BE DIVIDED BY 4? I know divided by 4 is : (t / 4). but can not be divided by 4?

Member Avatar for shuva
0
126
Member Avatar for OSiRiSsk

Hello, i have trouble with creating funkction that will remove white spaces if they are more than 1 in a row i have created this function so far [CODE=c]void VymazBiele() { int c; while ( (c = getchar() ) != EOF ) { if (isspace(c)) { putchar(' '); while ( …

Member Avatar for OSiRiSsk
0
542
Member Avatar for StaticX

Hi, Im having a bit of trouble with a problem: Basically, I have an array with a set size,for example [CODE]my_array[40][/CODE] I am trying to figure out how to tell if it has less than 20 characters filled,and if it has more than 20 characters filled. I have tried the …

Member Avatar for Tom Gunn
0
151
Member Avatar for th3learner

#include<conio.h> #include<stdio.h> main() { int a,b,c; clrscr(); printf("enter your first value:"); scanf("%d",&a); printf("enter your second value:"); scanf("%d",&b); printf("enter your third value:"); scanf("%d",c); if(a>b && a>c) { printf("first value is greater"); } else if(b>a&&b>c) { printf("2nd value is greater"); } else if(c>a&&c>b) { printf("third value is greater"); } getch(); Code runs …

Member Avatar for Gaiety
0
111
Member Avatar for pocku

I've just started started socket programming so there's a few things I'm wondering about: I found a set of socket programming codes here: [URL="http://cs.baylor.edu/~donahoo/practical/CSockets/textcode.html"]http://cs.baylor.edu/~donahoo/practical/CSockets/textcode.html[/URL] And the thing I don't really get is here in TCPEchoClient.c: [CODE]while (totalBytesRcvd < echoStringLen) { /* Receive up to the buffer size (minus 1 to …

Member Avatar for nirveshverma
0
179
Member Avatar for jcarlos.alvarez

Hi, I have 2 hexa arrays of 8 bytes and need to do an xor of them, something like this: [CODE=C] unsigned char xorBufferTemp[8]; unsigned char bufferHexas1[8]; unsigned char bufferHexas2[8]; [/CODE] I'd like to make something like that ... [CODE=C] for (i=0; i<8> i++) { xorBufferTemp[i] = bufferHexas1[i] ^ bufferHexas2[i]; …

Member Avatar for jcarlos.alvarez
0
190
Member Avatar for needhelpe

th program i made does not work!!! it should input an integer between 1 and 9. and then output a palindrome. for example if i input 5, the output should be 123454321. if i input 1, it should output 1. and so on... this is the program i made: #include …

Member Avatar for WaltP
0
116
Member Avatar for needhelpe

hello! I just made a palindrome. that inputs an integer between 1 and 9, and should output: for example if i imput 5 output :123454321 if i input 1 output: 1

Member Avatar for needhelpe
0
86
Member Avatar for jcarlos.alvarez

Please I need a help only in ansi c. I have an array of hexa values, for example: int N=3; char myHexas[N]; myHexas[0]=0x12; myHexas[1]=0x34; myHexas[2]=0xAB; I need to have a new array with the following: myStrings[N*2]; myStrings[0]='1'; myStrings[1]='2'; myStrings[2]='3'; myStrings[3]='4'; myStrings[4]='A'; myStrings[5]='B'; Any ideas should be great. Thanks in advance, …

Member Avatar for jcarlos.alvarez
0
207
Member Avatar for jjepoy

can someone tell me what those %7 and %4 means? I've tried solving it using calculator but my answers are really different from this code? [code]#include<stdio.h> main () { int year=1996, daycode; daycode=((year-1)*365+((year-1)/4)-((year-1)/100)+((year-1)/400)+1)%7; printf("%d",daycode); } [/code] and also this one [code]#include<stdio.h> main () { int year=1996, leapyear; leapyear=(!(year%4)&&(year%100))||!(year%4); printf("%d",leapyear); } …

Member Avatar for Grn Xtrm
0
108
Member Avatar for VBNick

Hello! I am trying to read a value from the registry, but I can't get it to work. Everything compiles, but RegQueryValueEx keeps producing an error. this is the code: [code lang="cplusplus"] #include "stdafx.h" #include <windows.h> #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { HKEY hKey = …

Member Avatar for VBNick
0
171
Member Avatar for wanted08

hey .. how are u all ?? I have c++ problem .. i tried to solve it but i couldnt get the same input .. [COLOR="Green"]here is the problem:[/COLOR] Given the following file called “input.txt” which contains the freezing and boiling points of several substances. Note: the title is not …

Member Avatar for Tom Gunn
1
505
Member Avatar for Nitricity

Hi i am writing a program to convert a user entered integer number into its binary representation, the aim is to repeatedly ask the user to enter a value then output the number in binary and when 9999 is entered end program, i've managed to make it work with positive …

Member Avatar for Nitricity
0
1K
Member Avatar for claire89

im trying to separate words from a sting, whem the code replaces the space for the ' \0' i need to increment the "pos" so i can continue read the array the code so far is this [CODE= c] #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 100 void separa_pal(char …

Member Avatar for csurfer
0
91
Member Avatar for panagos

I finnaly got working the program with <ncurses.h> in the virtual box that i put Ubuntu. A test program for handling the screen is given to us, [U]this:[/U] [CODE]#include <ncurses.h> int main(int argc, char **argv) { int X = 10; int Y = 10; int ch; initscr(); noecho(); keypad(stdscr,TRUE); move(Y, …

Member Avatar for dkalita
0
223
Member Avatar for ubi_ct83

hello guys, i have this code in java.but i need to convert to c.but i dont know java at all.hope u can help me.thanks for advance [CODE] public class Main { static int t_value=2; static int no_of_parameter = 0; String binary_setting; static int data[]; static ArrayList<String> constraint = new ArrayList<String>(); …

Member Avatar for yellowSnow
0
103
Member Avatar for arasucute

0,0 0,w-4 0,w +------------------------------------------------------+---+ | My Window | x | 2,0+------------------------------------------------------+---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | …

Member Avatar for Ancient Dragon
0
171
Member Avatar for arasucute

0,0 0,w-4 0,w +------------------------------------------------------+---+ | My Window | x | 2,0+------------------------------------------------------+---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | …

Member Avatar for Grn Xtrm
-1
182
Member Avatar for siggivara

Hi. I have this codeline: [CODE=c]fprintf(file, "The\necake\nis\na\nlie");[/CODE] When I compile and run in Linux it outputs nicely like so: The cake is a lie but when I compile and run in Windows (Vista), using cygwin, the newline doesn't work and output is like this: Thecakeisalie Anybody have an idea why?

Member Avatar for Tom Gunn
0
667
Member Avatar for Ineedhelpplz

Please help me find the endless loop and how to fix it: [QUOTE]blade71(555)% showxbits_2 32 in itox, processing 32 Test Value (b div 16): 2 Value of b: 32 Value of b (# mod 16): 0 [/QUOTE] [CODE]/* * stubs for functions to study * integer-hex conversions * */ #include …

Member Avatar for Gaiety
0
168
Member Avatar for ekkh90

I'm totally lost in my c++ class.. can someone guide me or help me?? Problem 1 Write a C++ program that writes all binary sequences of length 15 into a file binary15.txt. -The sequences must be in increasing lexicographic order. The output filestream must be created with the command ofstream …

Member Avatar for AirGear
-2
112
Member Avatar for aumi

Hi, i need some help. i have an assignment on "Airline Ticket Reservations System". i have to submit it on 10th August, 2008. I tried but can't solve it. please help me. The question is given below : 1. Consider a new airline agency “BEST AIR” that launches recently in …

Member Avatar for ithelp
0
322
Member Avatar for hket89

Standard telephone keypads contain the digits 0 through 9. The numbers 2 through 9 each have three letters associated with them, as indicated by the following table: Digit Letter 2 A B C 3 D E F 4 G H I 5 J K L 6 M N O 7 …

Member Avatar for hket89
-2
504
Member Avatar for smi ensi
Member Avatar for needhelpe

hello! I am having problems with a palindrome program. I have to input an integer between 1 and 9. and then the output has to be: for example if I input 4: output: 1234321 if I input 5: output: 123454321 if 1 output: 1

Member Avatar for twomers
-2
391
Member Avatar for Tvirusx1

Hello I am new to DaniWeb and this is my first Thread. I am currently trying to develop a bot for the Game DarkOrbit. I used WPE Pro and I found out that I could controll the Spaceship by sending specific Packets (I have some Packet codes already). Well heres …

Member Avatar for Tvirusx1
0
171
Member Avatar for shahab.burki

Hi, Some tough days for me doing a project in network project in C. Now I have seen various sites but found no solution. My question is that how to produce random numbers between 50 to 250 using rand() or srand in C? I am using gcc4. Thanks Shahab

Member Avatar for twomers
0
67
Member Avatar for Gaiety

/* difference between %i ad %d %i reads the value and it recognizes the value as what base it is when we read the value as 023 (base 8) it is 19 (base 10) and 0xa(base 16) it is 10 in (base 10). */ OUTPUT: /* Enter a number:023 Out …

Member Avatar for Ancient Dragon
1
161
Member Avatar for VernonDozier

I've googled this and it looks to me like what I am trying to do is impossible. I'm trying to write a [ICODE]Display[/ICODE]function that can take different parameters and call the appropriate function based on those parameters (i.e. function overloading). I've read that C doesn't allow this, but I figured …

Member Avatar for VernonDozier
0
111
Member Avatar for gmauger

Hi All, I'd like to declare a static array in a header file. Is this possible? I assume there is a fairly simple solution to this, but I have not been able to find documentation on the correct syntax for this. Just to be abundantly clear, I'd like to do …

Member Avatar for gmauger
0
15K
Member Avatar for ingenia

Hi , I am studying C programming.I am suppossed to do a task whic is - if we place an object of any shape or size on a scanner ,the program should foud the pixel of the object placed . Then it should calculate the exact area of the object …

Member Avatar for Rashakil Fol
0
74
Member Avatar for ahaZohan

Hi, I have 2 arrays and i want to put them in one array. array1[10]="hello" array2[10]="you" array12[10]="hello you" How can I do this. Many thx!

Member Avatar for Aia
0
85
Member Avatar for ashok.g15

Why do some code for eg in gstreamer etc use code which has code like struct xxx { int foo; ... .. char arrURI[1]; char data[0]; }

Member Avatar for Tom Gunn
1
952
Member Avatar for macdonald12

Hello all, I'm trying to make a program in C, but it's actually the algorithm that's giving me hell. The goal is to create a program that calculates and displays the [I]total number of end-locations[/I] (all locations, including similar ones) an object can reach in a 2d board (grid), using …

Member Avatar for SVR
0
188
Member Avatar for siggivara

I've made this rather messy method that is supposed to split the message parameter (max 160 byte) into 60-byte strings if it is larger than 60 bytes. The message is always between quotes so I also want to ignore them and just get whats between the quotes. Example: "Hi there …

Member Avatar for siggivara
0
196
Member Avatar for shahab.burki

Hi, I am doing network programming in C. I want to send Hexadecimal data between client and server. But stuck how C handles Hexadecimal values? I would like to put and example. I am having a variable ACK_CODE 0*81. Now want to send it. Since the send call can only …

Member Avatar for gerard4143
0
140
Member Avatar for Gaiety

Hi, i am presently working on C but there are some situations i need to know the assembly code of corresponding C program. if any can provide some general info of c - assembly it would be appreciated. i have a program called [CODE=C]int main() { printf("Hello,Plz Help\n"); return 0; …

Member Avatar for gerard4143
0
209
Member Avatar for noble3ad

Hello all, I have written a program that stores randomly generated numbers between 0 and 19 into an array of 100 elements. I create a frequency array of 20 elements that shows the frequency of each number and print it's histogram. Now, I'm suppose to increase the frequency array by …

Member Avatar for mevanga
0
2K
Member Avatar for kyllle

Hi all, Going to begin learning C# and then ASP.NET and was wondering if anyone knew of any good websites teaching beginner level C# or if anyone has any advice for me before I begin my mission! Thanks in advance! Kyle

Member Avatar for avirag
0
126
Member Avatar for ritesh chandora

actually I am new comer in C programming environment. The general C language has been completed by me. I want to learn visual or hardware level programming but I have no reference for that. anyone who knows good book, link, or any material related to visual or hardware programming. than …

Member Avatar for ritesh chandora
0
129
Member Avatar for hket89

Could Someone tell me whats the diffrence between call-by-value with call-by-refference?

Member Avatar for BestJewSinceJC
0
178
Member Avatar for moneeka

1. Develop sigma and pie bonding and anti bonding molecular orbitals of 2s and 2p Using C or C++ programming language. Expected Outcome: I. Shape of molecular orbitals must be known in depth. II. Proper assignment of bonding and anti bonding molecular orbitals should be stated. III. Proper computer program …

-2
58
Member Avatar for PennKen2009

I'm new at C++ and I'm trying to right a program that will generate random numbers from a range of 1-19. Here's how it should work, the program will generate 5 random numbers all ranged 1-19 and in random order. Once it chooses the first number, that number used for …

Member Avatar for zati
0
760
Member Avatar for makymakaru

Is pass by value and call by reference the same? I mean i know theres no call by reference in C but there is similarity int he output of the two isn't it? why do we use call by value and pass by value? what are its uses?

Member Avatar for Tom Gunn
0
103
Member Avatar for geoffy0404

im just so stressed and having a mind block.. i have code please help [CODE]#include <stdio.h> /*pre-defined processor statements*/ #ifndef __OPERATION__ #define __OPERATION__ #define TOTAL 0 #define ADDITION 1 #define SUBTRACTION 2 #define MULTIPLICATION 3 #define DIVISION 4 #define MODULAR 5 #endif int main() { /*assign the variables*/ int num1 …

Member Avatar for Aia
0
128
Member Avatar for Ineedhelpplz

I have already completed my hex to integer conversion function which works properly with the provided driver. However, my integer to hex function gets stuck in an infinite loop and I have no clue why. The red section of my code is the function which is giving me problems. Everything …

Member Avatar for Ineedhelpplz
1
384
Member Avatar for ammalu

please help me to develop a program in C for the given problems? 1. Read the string and print the first letters of word? 2. Read the array elements and find the greater and smallest after sorting it? 3. Read the string and print the digits and vowels ?

0
51

The End.