19,876 Topics

Member Avatar for
Member Avatar for Max_14

Write a program that reads integers, finds the largest and counts the occurrences. Assume that when the user enters it ends the sequence. Example : 3 5 5 5 0 Largest : 5 Occurrences : 3 I can't use arrays . I know I'm suppose to use loops but I …

Member Avatar for jnneson
0
166
Member Avatar for COKEDUDE

I am trying to do Shortest Remaining Time scheduling algorithms turnaround time. This is the formula. Turnaround Time = Completion Time - Arrival Time I have already sorted my arrays. This is what it looks like my hand. 5,1 done with magical 0 9,2 2nd iteration 1 2,4 1st iteration …

Member Avatar for Taywin
0
135
Member Avatar for COKEDUDE

Yes I know the code is not complete. I know it will cause an infinite loop. The question is how would I break out of the first for loop and go to the second for loop? Wouldn't using break, break you out of everything? I only wanna break one level. …

Member Avatar for overwraith
0
156
Member Avatar for Callie C.

The program seems to be building fine however I can only get it to return "Your tax amount is: 0.00". I've stared at the thing for hours and cann't for the life of me find my problem/problems. Any suggestions are extremely appreciated. /* * File: main.cpp * Author: Callie Tester …

Member Avatar for ddanbe
0
202
Member Avatar for joe97

guys i have this assignment about luhns algorithm and i cant seem to know where to start (i am very weak in functions and arrays) , if anyone can help me out with the start of the i would be very thankful then later on i will be disscussing my …

Member Avatar for joe97
0
5K
Member Avatar for COKEDUDE

BESIDES having to do a bunch of unnecessary iterations in a for loop with strlen doesn't it also produce weird behaviors? http://www.cprogramming.com/tips/tip/dont-use-strlen-in-a-loop-condition The documentation uses size_t instead of int. I believe I got weird behaviors when it happened. I didn't write it down when it happened so I can't remember …

Member Avatar for ddanbe
1
245
Member Avatar for sirlink99

Hello All, I am having trouble looping through a 2D array in C++ (should be very easy, but I am just starting C++). At the current moment I have this class file #include "Cube.h" #include <freeglut.h> #include <stdio.h> Cube::Cube(int cx, int cy, int cz , int cubeWidth) { int p[][3] …

Member Avatar for David W
0
474
Member Avatar for progteacher2

please help me write a program that lets the user enter 5 integers then outputs the folllowing a. whether the integer inputted is odd or even b. determines the largest and smallest number inputted c. sum all odd integer entries d. sum all even integer entries here is the partial …

Member Avatar for Taywin
0
112
Member Avatar for negru

I am having a problem when trying to delete specific record from a text file. Data structure is as follows: typedef struct { char id[9]; char name[50]; float amount,price; }PRODUCT; typedef struct id { char key[9]; int address; }ID;//for searching typedef struct node { ID id; struct node *left,*right; }NODE; …

Member Avatar for rproffitt
0
279
Member Avatar for Ananthoju

How to detect the keylogger softwares which are running in the system. Keylogger run in hidden mode,by the processes running in the background are us to detect it. Is there any process/me3thod to get complete details of process i.e, how muchmemory,cpu,harddisk spae are using and which files in drive are …

Member Avatar for overwraith
0
222
Member Avatar for sherwin_2
Member Avatar for rproffitt
0
112
Member Avatar for chrisschristou

hello every body here i got some problem with assign value to arrays, so i want to print multiplication table of the arrays: #include <stdio.h> int main(){ int x=5; int y=5; int i,j; int tab[x][y]; for( i=0; i<x; i=i+1){ tab[i][j]=i; for(j=0; j<y; j=j+1){ tab[i][j]=i; printf("%d", tab[x][y]); } printf("\n"); } return …

Member Avatar for rproffitt
0
289
Member Avatar for san_man

I have to create a random matrix m*n where m and n are user inputs. Now i have to fill the matrix with random nos. Finally I must have a matrix where each value is either 0 , 1 , a fraction no between 0 and 1, and also sum …

Member Avatar for ddanbe
-2
316
Member Avatar for Dmennite

Everything I have found shows how to add a row to a database for new images... I am trying to update an existing row with a longblob field to store a logo and cannot seem to grasp what to do Any help would be greatly appreciated

Member Avatar for Ehab_1
0
2K
Member Avatar for norEdz

how to do this? write a c++ program that given the name of a text file reads that file and counts the number occurrences of each alphabetic letter in the text. treat upper and lower case instances of a letter as the same letter. hint: look up tolower()---testing the case …

Member Avatar for David W
0
11K
Member Avatar for raj208851

I always get errors in c programming while using if and else as " expected expression before else". Why do this error display?

Member Avatar for Taywin
0
790
Member Avatar for jerome2467

hi i got a bank account project and i dont know how to figure out this problem i need to be able to transfert money from checking account to saving account if someone can help me with an exemple ,because i am a bit lost thanks by advance

Member Avatar for Sudarvizhi_1
0
6K
Member Avatar for DS9596

Using an initialization list for a class array variable, what do you use to setup a slot with a 3parameter Ctor?

Member Avatar for rubberman
0
136
Member Avatar for DS9596

How does an array variable indexing expression differ from an array definition size expression?

Member Avatar for rubberman
0
141
Member Avatar for Leonard_3

Hello, Leonard here. And my next program is a bit of a doozy. I'm making a ToDo List program. I had to make a getData() function to read a file from Notepad, with the day of the month and the task to do on that day and store them into …

Member Avatar for rubberman
0
187
Member Avatar for Agilemind

I'm trying to optimize a Bayesian inference algorithm written in C. I'm looking for fast and accurate open-source libraries for working with probability distributions (both calculating density & drawing deviates - like the rnorm,dnorm,pnorm functions in R). So far I've found a tutorial which suggested the [gsl](http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html#Random-Number-Distributions) library but I …

Member Avatar for rubberman
0
157
Member Avatar for cambalinho

i'm trying getting the richedit caret positions. seems that i can't use the caret functions. LONG firstCharIndex(HWND hwnd) { POINT pt; pt.x=0; pt.y=0; LONG n = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)&pt); return LOWORD(n); } COORD GetCaretPos( ) { COORD pos; //getting the line from caret position: pos.Y=(LONG) SendMessage(consoleedit, EM_LINEFROMCHAR,(WPARAM)-1,0); CHARRANGE cr; …

Member Avatar for cambalinho
0
558
Member Avatar for ShiftLeft

I'm in the process of designing a console personal/business finance package for Linux. It's easy to identify the advantages of data abstraction through classes, but I'm not inclined to become proficient with STL or containers. Exception handling may become a consideration, but definitely memory allocation via "new". My own implementation …

Member Avatar for ShiftLeft
0
1K
Member Avatar for Nikusha.Kalatozi

Can someone tell me the formula codes of how to 1 find and write the total number of massive elements om massive number(random massive numbers) 2 find and write the biggest random massive number(random massive numbers) 3 find and write the smalles random massive number(random massive numbers) 4 how to …

Member Avatar for JOSheaIV
0
136
Member Avatar for DS9596

Define an int array variable named arx with 3 slots, and stuff a 7 in the last slot int arx[2]=7; or is it: int arx[3]; arx[2]=7; Is this correct?

Member Avatar for David W
0
229
Member Avatar for srikanth112

Write a program to find grace marks for a student using switch. The user should enter the class obtained by student and the number of subjects he has failed in uses the follow logic.  if the student gets first class and the number of subjects he failed in is …

Member Avatar for Ali_52
0
643
Member Avatar for Aldair -

**Well guys , i have a problem , i have got my linked list , it add numbers (to the list) , and show numbers(from the list ) , but i can´t add the numbers of the list , i really need help , if the list would be: 1) …

Member Avatar for Taywin
0
216
Member Avatar for Izzah_2

#include <stdio.h> #include <conio.h> void main() { int m; int n; int multi; printf("enter value : "); scanf ("%d", &m); printf("enter value of multiply : "); scanf ("%d", &n); multi = multiply(m,n); printf("the value of multiply : %d", multi); } int multiply (int m, int n) { if (n == …

Member Avatar for Izzah_2
0
165
Member Avatar for lewashby

When I try to compile the program below in Eclipse I get two erros, ‘const class Fraction’ has no member named ‘n’ & ‘const class Fraction’ has no member named ‘d’ When I compile it on the command line with g++ -Wall FloatFraction2.cpp Fract7.cpp -o FloatFraction I get more errors …

Member Avatar for マーズ maazu
0
581
Member Avatar for DS9596

C++: I'm using Microsoft Visual Studio 2012 and I am not sure what to do about these two errors: 2 IntelliSense: identifier "x" is undefined Error 1 error C2065: 'x' : undeclared identifier Prompt: Make program that reads 20 integers, display that array, and find min, max, sum, and avg. …

Member Avatar for ddanbe
0
397
Member Avatar for Divyang_1

i am trying to write code for login system .. but .. i know how to work normally .. nut how to create ..perfect i dont know , help me

Member Avatar for jwenting
0
236
Member Avatar for joe97

Pig is a simple dice game first described by John Scarne in 19451. It is a form of jeopardy dice game, where a players decisions are between protecting current gains, or risking current gains to make greater gains. In Pig, each player takes a turn rolling a 6-sided dice, playing …

Member Avatar for joe97
0
1K
Member Avatar for Leonard_3

Hi guys, My name is Leonard E Norwood Jr. I'm a senior at Norfolk State University and a beginning of programming. I'm just working on a small program on my own time to practice. So you're familiar with the playing cards and the logic of dealing a deck with 4 …

Member Avatar for tinstaafl
0
3K
Member Avatar for Duki

Hey Everyone, I'm doing a little test for a presentation I'm giving on Tuesday. I wanted to show the performance difference between VB2008, C# and C++. To do this, I have three programs. Each program performs the Fibonacci sequence X times, and can either do it iteratively or recursively. As …

Member Avatar for Loïc
0
940
Member Avatar for christian_5
Member Avatar for rproffitt
0
63
Member Avatar for Hermelix

Can somebody help me, why this aren't working? I always get: else without a previous if PS: I'm from Austria, sorry for my bad English :) #include <stdio.h> int main(void) { int w; double v, s, t; printf("Dieses Programm berechnet Geschwindigkeiten, Wegdifferenzen und\n" "Zeitdifferenzen fuer eine gleichfoermige Translation.\n" "1 ... …

Member Avatar for AndrisP
0
591
Member Avatar for jeffersonalomia

I am wondering if it is safe to debug a c++ code on my website? If theres an article that talk about that pls. post the link together with your reply. Thank you :)

0
104
Member Avatar for cambalinho

how can i resize a window console buffer? i know that i can use the SetConsoleScreenBufferSize(), but i'm getting problems convert from pixels to characters, because the vertical scrollbar is showed and the size isn't changed correctly, because it's more big than the buffer size: CONSOLE_SCREEN_BUFFER_INFOEX consolesize; consolesize.cbSize=sizeof(consolesize); GetConsoleScreenBufferInfoEx(hConsole,&consolesize); COORD …

Member Avatar for rproffitt
0
2K
Member Avatar for Mayukh_1

I have a small snippet. It is related with several malloc statements. Can somebody please explain. #include <stdio.h> #include <stdlib.h> int main(){ char* ptr1 = (char*)malloc(10); free(ptr1); char* ptr2 = (char*)malloc(10); free(ptr1); char* ptr3 = (char*)malloc(10); free(ptr1); return 0; } **What will happen to the snippet..? Will the malloc for …

Member Avatar for rubberman
0
128
Member Avatar for DS9596

I'm getting these types of errors: identifier "gm" is undefined or expected a ';' How do I fix these errors? #include <iostream> #include <cstdlib> //srand #include <ctime> //time #include <cmath> #include <string> using namespace std; int G_master; int m_secret; int m_choice; int m_win, m_prev_delta; int Number_guess; int Card_guess; int delta; …

Member Avatar for David W
0
461
Member Avatar for rizrash

Hey friends i am so excited to join this forum !! its been 3 month since i`ve been learning turbo C !! Now i`ve started lerning and making alot of programs !! Well i am going through one error which is quite funny !! i hope someone of you can …

Member Avatar for David W
0
675
Member Avatar for ravi_14

Hi All, I am trying to implement generic link list in c++ . But getting below error . Please assist me to correct it. LinkedList.hpp LinkNode<E>* head; errr: unknown tpe name ''LinkNode // LinkNode.hpp // cplus // // Created by Ravi Rathore on 10/12/15. #ifndef LinkNode_hpp #define LinkNode_hpp #include <stdio.h> …

Member Avatar for deceptikon
0
288
Member Avatar for Queen_1

Hi guys! I have a program that makes you choose what kind of number conversion you would like to do between Binary to Octal and Binary to Hexadecimal . Here's the function that converts binary to hexadecimal: int bintohex(void){ fract=0; bits=0; printf("Enter any binary number: "); while ((ch=getchar()) != EOF …

Member Avatar for David W
0
245
Member Avatar for COKEDUDE

I have this print statement. printf("(n * o ) % m == 0 is invalid so exiting. \n"); And this is the output. (n * o ) Success == 0 is invalid so exiting. I don't even have the word "Success" anywhere in my program. I don't see anything in …

Member Avatar for nullptr
0
111
Member Avatar for COKEDUDE

Can someone please explain these errors? I don't have a multidimensional array so I don't understand how I'm getting this error. main.c:291: warning: passing argument 2 of ‘type_specifier’ from incompatible pointer type main.c:263: note: expected ‘int *’ but argument is of type ‘int **’ main.c:291: warning: passing argument 3 of …

Member Avatar for deceptikon
0
438
Member Avatar for keval_hack

[I]Interesting tricky program using C & C++: [/I] [B]Program 1:[/B] Create a Program which produce output "Hello World" , the program must not contains semicolon ; in other word any statement of the program will not have a termination semicolon. [B]Program 2:[/B] Write a C or C++ program which run …

Member Avatar for Ahamed_1
-1
2K
Member Avatar for COKEDUDE

I am trying to pass the address of strings_line_tokens to split_string. I would think I would need the "&" for the address then one of these methods would work. static void split_string(const char *buffer, size_t buflen, char ***strings_line_tokens) static void split_string(const char *buffer, size_t buflen, char **strings_line_tokens) static void split_string(const …

Member Avatar for deceptikon
0
247
Member Avatar for COKEDUDE

I'm getting infinite recursion here. I'm sorry if this is obvious but I don't see what I'm doing wrong here. program() gets called from main, then program() calls declaration_list(), then declaration_list() calls declaration(). I don't see how in the function declaration_list it ever calls declaration_list() again when right before that …

Member Avatar for overwraith
0
157
Member Avatar for COKEDUDE

Yes I did read these two posts. http://stackoverflow.com/questions/3082914/c-compile-error-variable-sized-object-may-not-be-initialized http://stackoverflow.com/questions/14186879/c-error-variable-sized-object-may-not-be-initialized My case is a bit different because I'm using `char * ptr[buflen]`. This is what I have tried: char *ptr[buflen] = {0}; //This gave me the variable sized object error. char *ptr[buflen]; memset( ptr, 0, buflen*buflen*sizeof(char)); //I figured this would work …

Member Avatar for deceptikon
0
8K
Member Avatar for James_43

Hey there, Over the past few weeks as an excerise I've been trying to create a C# image viewer. At the moment I have one window, with a list of images displayed in a ListBox. When I the F5 button, a second window pops up at fullscreen, and I want …

Member Avatar for James_43
0
1K

The End.