Recent content by carl123
-
C
Undergrad Reverse a String in C - Solve Segmentation Fault
Thanks for your reply. Pls could you explain further. Not sure what you mean- carl123
- Post #3
- Forum: General Math
-
C
Undergrad Reverse a String in C - Solve Segmentation Fault
This is what I came up with but I keep getting segmentation fault whenever I run it in linux. Not sure why. Any help would be appreciated. Thanks #include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char** argv) { int i, childpid; for (i = strlen(argv[1]); i >=...- carl123
- Thread
- Reverse String
- Replies: 6
- Forum: General Math
-
C
Comp Sci How to debug an infinite loop in a C++ program using fork gymnastics?
Can you explain what you mean sorry?- carl123
- Post #3
- Forum: Engineering and Comp Sci Homework Help
-
C
Comp Sci How to debug an infinite loop in a C++ program using fork gymnastics?
This is what I did but I'm getting an infinite loop of the reversed string whenever I run the program. I don't know why #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> /* for fork() and getpid() */ #include <sys/types.h> #include <iostream> using namespace std...- carl123
- Thread
- C++ Linux Program Programming
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
C
Comp Sci Book Database Implementation C++
I began by creating 2 classes. A book class and a course class that contains any necessary info about the book and course respectively class bookClass{ private: string theISBN; string thebookName; string thebookAuthor; double thebookCost; int...- carl123
- Thread
- Book C++ Classes Database Functions Oop
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
C
How to Implement a Salami Memory Allocator in C?
Thanks for the input everyone. All your suggestions have given me a clear idea of what I'm supposed to do. Appreciate it- carl123
- Post #5
- Forum: Programming and Computer Science
-
C
How to Implement a Salami Memory Allocator in C?
Salami Allocator In this warm-up submission you will write a totally trivial allocator: The function init allocator() reserves a given portion of memory for the allocator. Every call to my_malloc() cuts off the requested amount of memory from the remainder of the reserved memory. The call to...- carl123
- Thread
- Computer science Memory Programming
- Replies: 4
- Forum: Programming and Computer Science
-
C
MHB Assign a pointer to any instance of searchChar in personName to searchResult.
Ok, I was able to figure it out. I added this: searchResult = strchr(personName, searchChar); and it works. Thanks!- carl123
- Post #3
- Forum: Programming and Computer Science
-
C
MHB Assign a pointer to any instance of searchChar in personName to searchResult.
#include <iostream> #include <cstring> using namespace std; int main() { char personName[100] = "Albert Johnson"; char searchChar = 'J'; char* searchResult = 0; /* Your solution goes here */ if (searchResult != 0) { count << "Character found." << endl; } else {...- carl123
- Thread
- Replies: 2
- Forum: Programming and Computer Science
-
C
MHB Vector Field Formula for Graph in [-2,2] x [-2,2]
Their cross product is equal -
C
MHB Vector Field Formula for Graph in [-2,2] x [-2,2]
if the denominator is 0, the formula will be undefined. What does that say about the graph? Also, when I found the cross product of [-2,2] and [-2,2], I got 0. Does that mean, there's no field that resembles the graph? Thanks. -
C
MHB Vector Field Formula for Graph in [-2,2] x [-2,2]
where x = 1 is a singular point, the denominator will be 0 then. -
C
MHB Vector Field Formula for Graph in [-2,2] x [-2,2]
Will it be f (x,y) = f (-2,2)? -
C
MHB Vector Field Formula for Graph in [-2,2] x [-2,2]
Give an example of a formula for a vector field whose graph would closely resemble the one shown. The box for this figure is [−2, 2] x [−2, 2]. Not sure where to start. -
C
C/C++ Create a C++ logic calculator (T/F) using a recursive descent parser
I'm supposed to make a simple logic calculator based on the following requirements: 1. The user can use either capital or lower case 'T' and 'F' in their expression. 2. Use either a ';' or '=' to indicate the expression should be evaluated immediately. 3. The program should not exit when it...- carl123
- Thread
- C++ Calculator Logic
- Replies: 1
- Forum: Programming and Computer Science