19,876 Topics

Member Avatar for
Member Avatar for codecutie

I keep getting an error when using option 2. Could someone please point me in the right direction. [CODE]#include <iostream> using namespace std; int num; int Size; int choice; int *currentArray = 0; int *tempArray = 0; int index, oldSize, newSize; struct nodeType { int info; nodeType *Link; }; nodeType …

Member Avatar for programmersbook
0
137
Member Avatar for onesreality

Hi all, I am doing a school project. I am using a At89C51ED2 microprocessor and it is connect to a 2-Line LCD panel. My teacher need me to write a program of the digital clock using the timer in the microprocessor. He want me to show the word " clock: …

Member Avatar for nezachem
0
734
Member Avatar for bottledwater

hi all! i have been programming in C for about 4 months now, and i have the very basics down pretty well (functions, pointers, etc etc), and have been doing a lot of console apps, and i was hoping to do a fractals program. i have the algorithm down (at …

Member Avatar for Ancient Dragon
0
162
Member Avatar for hardlynoticable

Hi Guys, Take a look at the following code snippet: [code] <%@ Page Language="C#" ContentType="text/html" ResponseEncoding="UTF-8" %> <html xmlns="http://www.w3.org/1999/xhtml"> <body> <script runat="server"> void Page_Load() { Response.Write("This is a test"); } </script> </body> </html> [/code] It outputs the following: [code] This is a test <html xmlns="http://www.w3.org/1999/xhtml"> <body> </body> </html> [/code] (note …

0
67
Member Avatar for astala27

Q. Using recursion, write [B]a[/B] C++ function into [B]b[/B] to convert an arbitrary integer n>=0 into binary. Call this function in the main program with the argument n (That's an easy part I can do that). In example; input n=27, output 11011. If anyone can help me with this question, …

Member Avatar for n1337
0
112
Member Avatar for Iam3R

[CODE] /*dynamically allocating memory in called funcion and freeing in caller*/ char** memall(int ns); #define Max 20 #include<stdio.h> int main() { char **s; int i,ns; printf("no of string you want to store"); scanf("%d",&ns); s=memall(ns); for(i=0;i<ns;i++) printf("addrs =%u and string=%s\n",(s+i),s[i]); for(i=0;i<ns;i++) free(s[i]); free(s); /* s=NULL; for(i=0;i<ns;i++) printf("%s\n",s[i]); *///dont try to access …

Member Avatar for Dave Sinkula
0
103
Member Avatar for miskeen

Hi, I've a multifile program in C and I need to use global variables. I've one header file that is called "global.h" where my global variable is defined. In the other files, there's an include directive to "global.h". At the moment, I'm using my variable in the C files without …

Member Avatar for gerard4143
0
932
Member Avatar for MAV_DevWantaB

:-/AnyWay,, Here is what it is supposed to happen.... [COLOR="Green"]The input is a char array initialized with line of Text,, the program should tokenizes the line with the "strtok" function and should output the line of text in reverse order.... [/COLOR] I need to set up a "strcpy"..... I'm almost …

Member Avatar for Narue
0
2K
Member Avatar for Iam3R

Hi, I have little idea of padding. i read in one of the links that : all character variables gets stored in the memory location that is divided by 1. all short variables gets stored in the memory location that is divided by 2. all int variables gets stored in …

Member Avatar for gerard4143
0
145
Member Avatar for cyborg22

:) Hello experts, Im taking a C++ class and i was asked to Write a program that uses a structure named MovieData to store the following information about a movie: Title Director Year Released Running Time (in minutes) I've come down to making it compile, but, when it couts the …

Member Avatar for programmersbook
0
386
Member Avatar for carey_amanda

Im doing a school project. have to do dllimport as the SiUtil.dll is written in C++. But im not sure the coding below is correct as there is error. Please advise needed. [url]http://www.silabs.com/Support%20Documents/TechnicalDocs/an117.pdf[/url] Thanks a million. [CODE]using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.InteropServices; namespace ProgrammingInterface { static class Program …

0
71
Member Avatar for dennis.d.elston

I am trying to write a funtion that will return the value of 1 if its string argument is a palindrome. I have started but am unsure if it is correct. Could someone please take a look and point me in the right direction? Thanks [CODE]#include <string.h> Int palindrome (const …

Member Avatar for mrnutty
0
126
Member Avatar for blur_guava

i everybody, I am required to find out if the following is a standard practice to create a subclass. Take for instance, I have to create a class library (ClLib) with 2 classes using Visual Studio: Class1.cs &amp; Class2.cs. Next, I open up the .CSPROJ file of ClLib and modify …

Member Avatar for blur_guava
0
237
Member Avatar for jojomakinen

Hello to all code gurus! First of, I wouldn't lie, i am not a professional programmer.....I am more of the opposite. I was given a program to write during a 4 day C++ programmers boot camp that I signed up for (which ended friday actually). By profession am a graphic …

Member Avatar for jonsca
0
152
Member Avatar for ziyakhan10

I am trying to write a program to find nearest prime to a number to its left...using for loop i just don't seem to get it right [CODE] #include<iostream.h> #include<conio.h> void main() { clrscr(); int n1,flag=0; cout<<"Enter The Number"<<endl; cin>>n1; for(int i=n1;i>0;i--) { for(int j=2;j<(i/2);j++) { if(i%j==0) { flag=0; } …

Member Avatar for Skeen
0
4K
Member Avatar for Derp2000

Hello. :) This is my first post and it's unfortunately to ask for help. The problem is as follows: [LIST] [*]The user types in how many names they wish to enter. [*]An array must be able to hold this many names. [*]The user then types the names. [*]Any characters over …

Member Avatar for Derp2000
1
125
Member Avatar for Eternity[LK]

Hello. I have created a simple program which generates 3 random numbers, puts them in a text file, reads them, and then does 3 small calculations, results are put in another text file. Program is working correctly on my PC, however there is a catch. I need to submit it …

Member Avatar for jonsca
0
371
Member Avatar for Hitman Mania

CAn someone give the C code for this? thanks :) : A prime number is an integer, greater than 1, that is only divisible by 1 and itself. 3, 11, and 43 are examples of prime numbers. Twin primes are a pair of prime numbers which differ by 2. For …

Member Avatar for gerard4143
-1
99
Member Avatar for fenerista

do_gettimeofday(&tv1) current_kernel_time() do_gettimeofday function returns a value like that when the time was about 21:42: "1260819441.705069" and current_kernel_time() function returns a value similar to do_gettimeofday's value. the print code is for tv1: [CODE]len += sprintf(buf,"%10i.%06i\n",(int) tv1.tv_sec, (int) tv1.tv_usec);[/CODE] I don't know what these functions returns which time. I want to …

Member Avatar for fenerista
0
496
Member Avatar for basakua

sand watch (for height 4 : 4 lines in the upper half and 4 lines in the lower): INPUT: 4 OUTPUT: ******* ***** *** * * *** ***** ******* i am not sure how to form a shape like this with C. can you help me?

Member Avatar for gerard4143
0
103
Member Avatar for grimbaum

Hello all! I´m doing the n-queens prolbem in an recursive manner with a twist. The twist i the possibility to chose to place 2-8 queens in a 8x8 board.I have problem with storing the rows properly and print them at the right time inside the recursion,please feel free to give …

Member Avatar for hunter666
0
157
Member Avatar for Nogat21

Hello, i'm building a client-server application using sockets in C. I'm trying to send a structure through a socket, but the values after "deserialization" (the use of htonl-ntohl) come adulterated and i dont know why. Maybe you could help me? Here is the code: Server.c [code=c] #include <stdlib.h> #include <string.h> …

Member Avatar for gerard4143
0
207
Member Avatar for travism

I wrote the following function that takes a string with spaces and replaces the space with an underscore ( _ ). The function works, but I believe there is a less novice way of doing it. Anyone have any suggestions? BTW, this is written in Linux and compiled with G++. …

Member Avatar for travism
0
7K
Member Avatar for Vita1ity

I'm attempting to write a simple program which will sort a list of ten integers into descending numerical order for Second Life. I've no idea how to do this, or if its even possible, but if so it would greatly benefit the object I'm working on in game. Any help …

Member Avatar for Ancient Dragon
0
40
Member Avatar for javaStud

Hi. I am having some problems with files. I am trying to read some contents from a file, transfer them to an array and then read the contents of the array. The problem that I am facing is that the output is not that is suppose to be. The file …

Member Avatar for javaStud
0
92
Member Avatar for rehaam

Hi I need help;; Write a program to simulate a demand paging system. The program should implement the FIFO and LRU page replacement algorithms presented in Chapter 10 of the textbook. Your program input should include: The name of the page replacement algorithm. Information about the number of physical page …

Member Avatar for gerard4143
0
2K
Member Avatar for evolution120

Hi there, im new to c programming, just wanted to know is it possible to do a simple if else for 1 username login for C programming? thanks. and also, what does c2065 undeclared identifier means? how to fix it?

Member Avatar for mrnutty
0
74
Member Avatar for fradiavolo

Hello, below is my polynomial code. I had to add and multiply 2 polynomials. 1) All i have to do more is to sort decreasingly the adding() and product() functions. Eg: 4x^6 + 6x^4 + 2x^2... etc. 2) Second, to add the coefficient with the similar exponents, same in the …

0
78
Member Avatar for YoTaMiX

Hello to you all , I am required to write a program which gets a Math Expression (without checking it is good) and put in Stack only the Brackets . Implementation of Stack is One-Way Linked List Only. Examples for Good/Bad Expressions : (a*{b+c}-4/x +[e-5]) - GOOD (5+} - BAD …

Member Avatar for Berkut
0
283
Member Avatar for Placinta

Hi. I have this part of code. [CODE] int main() { int **table = NULL; allocated_matrix(table, 3, 3); //next instructions } void allocate_matrix((what_type_here)table, int rows, int columns) { table = (int **) malloc(rows * sizeof(int *)); for (int i = 0; i < rows; i++) { table[i] = (int *) …

Member Avatar for Placinta
0
138
Member Avatar for azra36

in this code i check if i'm getting data blocks in order, if not inorder i return NULL,i.e ask for next block, if in order i write the contents of data block to a file pointed by fpdddb. the contents of DDB_Parser.BlockDataByte array keep changing every time. what is the …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for revenge2

Hello there, I am having trouble copying text into a string, what am i doing wrong? [CODE=c] #include <stdio.h> int main() { char instructions[80]; FILE *f; f=fopen("a3.txt","r"); while (fscanf(f,"%s",instructions != EOF){ fscanf(f,"%s",instructions); } printf("%s",instructions); } [/CODE] the contents of a3.txt are B404 239A 2412 5345 350C C000.

Member Avatar for fjallstorm
0
107
Member Avatar for rt.arti

Hello, I am trying to generate multiple files out of a single text file by changing one parameter. My text file is of the form -- p 3 6 [COLOR="Red"]n 1 1 n 3 -1[/COLOR] a 1 2 0.8 a 1 3 0.7 e 1 2 1 2 0.7 e …

Member Avatar for nezachem
0
100
Member Avatar for Stefano Mtangoo

I see alot of libraries written in C and I like C++ OOP way. How can I use a given C library functions in C++?

Member Avatar for Stefano Mtangoo
0
176
Member Avatar for 07tr0wa07

Hi guys i'm new in C++..:icon_wink: I have a homework that i need to pass soon and i need help because i only have 1 error and i'm staring at it for 2 hours:icon_cry: going back and forth to my book and came up with no solution:icon_sad:. ok so heres …

Member Avatar for Lerner
0
277
Member Avatar for Stefano Mtangoo

Some C++ buzzwords a programmer need to grasp really boggles my mind. I try to understand them but I strangely, get dim understanding of them (am I tired? Need a vacation?). Anyway please help me understand the following big words in C++ 1. Virtual Functions 2. Polymorphism Thanks alot

Member Avatar for Stefano Mtangoo
0
654
Member Avatar for Mattpd

My attempt of a "bubble sort" only partially works. Say for example if this is my structure declaration: [code] struct part { char name [NAME_LEN+1]; char owner [OWNER_LEN+1]; char status [STATUS_LEN+1]; char date [DATE_LEN+1]; char renter [RENTER_LEN+1]; } parts [MAX_PARTS], temp [1]; [/code] and the following code print: Piston:Mike:In:: Hook:Mark:In:: …

Member Avatar for Mattpd
0
165
Member Avatar for Clinton Portis

I thought this website on coding conventions was pretty cool.. learned some things that I never knew before: [url]http://www.possibility.com/Cpp/CppCodingStandard.html#init[/url] I was just wondering: If there are any conventions in particular you agree or disagree with (and why) If this would be worthy of being a 'sticky post' as I think …

Member Avatar for Lawand
1
153
Member Avatar for naej

help! does anyone know how to make a snake game? using turbo c as a programming language using, if, if-else, if-else-if,for loop,while , do-while, array,and modular and nested if,if-else, if-else-if,for loop,while , do-while, array, thank you so much i really need it it's urgent dankey!

Member Avatar for mrnutty
-1
70
Member Avatar for raghuhr84

Hi All, I am facing the scanf() function problem, below given is a small code snippet where am facing the problem. [CODE] int main() { char str1[100]; char str2[100]; printf("Enter 1st string\n"); scanf("%[^\n]s",&str1); printf("Enter 2nd string\n"); scanf("%[^\n]s",&str2); printf("1st string is %s\n", str1); printf("2nd string is %s\n", str2); return 0; }[/CODE] …

Member Avatar for Dave Sinkula
1
691
Member Avatar for absk

I have been coding in C++ for a few years now and am comfortable with OOP concepts and Data Structures. Now I wish to pursue a higher level language which will hwlp me in application development. After much reading, I arrived at C# and Java. Which one should I pursue? …

Member Avatar for peter_budo
0
161
Member Avatar for kingster113

[CODE]#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> #include <conio.h> // Function prototypes void MainMenu(); void PaymentMode(); void get_password(); #define FIELD_SIZE 25 #define length(array) ( sizeof (array) / sizeof (array)[i] ) struct account { char *id; char *password; }; static struct account accounts[] = { { "alexander", "iamsolame" }, { …

Member Avatar for kingster113
0
318
Member Avatar for Vita1ity

Hey everyone, I've written a program for class but am not sure what the values of a and b are after the code fragment is executed. Anyone that can help me out? [code] int a = 16; int b = 45; bob (a, &b); void bob(int x; int *py) { …

Member Avatar for Aia
0
42
Member Avatar for ayan2587

hi frndz.... i was wondering that given 1<n<1000000 & 1<r<1000000 how do i [B][I]efficiently[/I][/B] find nCr (combination) for any given values of n & r. please help with an efficient algorithm...

Member Avatar for ayan2587
0
93
Member Avatar for pmee

Hi, I'm trying to figure out how to convert a hex number (that I read in from a file) to an 8 bit binary number. At the minute I'm converting the number from Hex to decimal to binary (which probably isn't the best way). The only problem I have with …

Member Avatar for iAmLast
0
983
Member Avatar for dewdropz

//ok i need to write a programme that asks the user to input student numbers as an array and check the initial number and allocate them into different classrooms.. my code looks lik ths: [CODE] #include <stdio.h> int number; int i; int student_number[10]; int total; int first[0]; int main (void) …

Member Avatar for jonsca
0
102
Member Avatar for Robyy14

Heya people i really would appreciate some help here.. The Program Works Just Fine At compiling but after like 1 second after ctrl + f10 to test it i get an error . I looked on google and it is something like Killed by signal 8(SIGFPE). [CODE] #include<cstdio> #include<cctype> #include<string> …

Member Avatar for Robyy14
0
11K
Member Avatar for maharjanmike

so far i was able to do for countting the letters in a phrase ..,but i am not able to count the words in a phrase and displaying according to the number of the word...here's my code to count the letters.. what changes should i make to count the words …

Member Avatar for maharjanmike
-2
105
Member Avatar for lisedaton

H ALL!! IT CAN BE SAID IM DONE WITH THIS PROGRAM THAT ITS MAKING ME CRAZY... BUT IM HAVING A PROBLEM... (I PAINT THEM RED AND WROTE THE PROBLEM BESIDE IT...) PLEASE PLEASE HELP!!!!!!!!!!!!!!!!!!!!!! THE PROGRAM IS SUPOSSE TO RECIEVE A SENTENCE AND THEN SPLIT IT TO WORDS AND COMPARE …

0
80
Member Avatar for fradiavolo

Hello, below is my polynomial code. I had to add and multiply 2 polynomials. 1) All i have to do more is to sort decreasingly the adding() and product() functions. Eg: 4x^6 + 6x^4 + 2x^2... etc. 2) Second, to add the coefficient with the similar exponents, same in the …

Member Avatar for Lerner
0
262

The End.